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

Commit

Permalink
update return types and remove pyaudio
Browse files Browse the repository at this point in the history
  • Loading branch information
MGTheTrain committed Apr 18, 2024
1 parent 2455cae commit 651caae
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions bindings/python/audio_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)):
"""
Expand All @@ -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))

0 comments on commit 651caae

Please sign in to comment.