From 651caae12f1c481db69d3e9c1fde07df0cdd2819 Mon Sep 17 00:00:00 2001 From: Marvin Gajek Date: Thu, 18 Apr 2024 20:13:40 +0200 Subject: [PATCH] update return types and remove pyaudio --- bindings/python/audio_wrapper.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/bindings/python/audio_wrapper.py b/bindings/python/audio_wrapper.py index e1579de..7dc6324 100644 --- a/bindings/python/audio_wrapper.py +++ b/bindings/python/audio_wrapper.py @@ -64,8 +64,6 @@ class AudioWrapper: Attributes: audio_lib (CDLL): The loaded audio library. - pyaudio (PyAudio): PyAudio instance. - audio_callback (PyAudio callback): The callback function for audio playback. """ def __init__(self, path: str): @@ -109,15 +107,7 @@ def start_playback(self, audio_data: ctypes.POINTER(AudioData)) -> bool: Returns: bool: True if playback was successfully started, False otherwise. """ - stream = self.pyaudio.open( - format=self.pyaudio.get_format_from_width(4), - channels=audio_data.info.channels, - rate=audio_data.info.samplerate, - output=True, - stream_callback=self.audio_callback - ) - stream.start_stream() - return True + return self.audio_lib.startPlayback(ctypes.byref(audio_data)) def close_audio_file(self, audio_data: ctypes.POINTER(AudioData)): """ @@ -126,5 +116,4 @@ def close_audio_file(self, audio_data: ctypes.POINTER(AudioData)): Args: audio_data (AudioData): The AudioData structure containing the audio data to close. """ - self.pyaudio.terminate() self.audio_lib.closeAudioFile(ctypes.byref(audio_data)) \ No newline at end of file