Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
import and utilize AudioData
Browse files Browse the repository at this point in the history
  • Loading branch information
MGTheTrain committed Apr 18, 2024
1 parent 79069c1 commit 72c5a53
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bindings/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import os

from core_wrapper import CoreWrapper
from audio_wrapper import AudioWrapper
from audio_wrapper import AudioWrapper, AudioData

def main(path, wrapper_type, audio_file_path):
"""
Expand Down Expand Up @@ -62,15 +62,16 @@ def main(path, wrapper_type, audio_file_path):
elif wrapper_type == 'audio':
audio_wr = AudioWrapper(abs_path)

if not audio_wr.load_audio_file(audio_file_path):
audio_data = AudioData()
if not audio_wr.load_audio_file(audio_file_path, audio_data):
print("Failed to load audio file:", audio_file_path)
return

if not audio_wr.start_playback():
if not audio_wr.start_playback(audio_data):
print("Failed to start playback.")
return

audio_wr.close_audio_file()
audio_wr.close_audio_file(audio_data)
else:
print("Unsupported wrapper type provided.")

Expand Down

0 comments on commit 72c5a53

Please sign in to comment.