From 63d04477b27b63afab5f45bf11c5943303eac1ca Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 29 Apr 2023 10:40:19 -0700 Subject: [PATCH] resetting and leaving comment for future --- audio/audio.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/audio/audio.py b/audio/audio.py index ca4213a..c51c743 100644 --- a/audio/audio.py +++ b/audio/audio.py @@ -106,10 +106,20 @@ class Audio: p = pyaudio.PyAudio() # open stream based on the wave object which has been input. + # todo: figure out how to play for any output device + + # this works on my mac + # stream = p.open( + # format=p.get_format_from_width(wf.getsampwidth()), + # channels=wf.getnchannels(), + # rate=wf.getframerate(), + # output=True, + # ) + stream = p.open( format=p.get_format_from_width(RESPEAKER_WIDTH), channels=RESPEAKER_CHANNELS, - rate=8000, + rate=RESPEAKER_RATE, output=True, output_device_index=RESPEAKER_INDEX, )