From b856d9370cb405fff4b1a3519ce1785463f99421 Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 29 Apr 2023 10:36:54 -0700 Subject: [PATCH] try to make it work for rpi speakers --- audio/audio.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/audio/audio.py b/audio/audio.py index 3b25c47..cbf126a 100644 --- a/audio/audio.py +++ b/audio/audio.py @@ -107,10 +107,11 @@ class Audio: # open stream based on the wave object which has been input. stream = p.open( - format=p.get_format_from_width(wf.getsampwidth()), - channels=wf.getnchannels(), - rate=wf.getframerate(), + format=p.get_format_from_width(RESPEAKER_WIDTH), + channels=RESPEAKER_CHANNELS, + rate=RESPEAKER_RATE, output=True, + output_device_index=RESPEAKER_INDEX, ) # read data (based on the chunk size)