From bebec796622977d2e07cf0047884b54b34ee0ef1 Mon Sep 17 00:00:00 2001 From: talksik Date: Thu, 27 Apr 2023 14:40:22 -0700 Subject: [PATCH] fixing bugs --- audio/audio.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/audio/audio.py b/audio/audio.py index 4ef7373..280d12b 100644 --- a/audio/audio.py +++ b/audio/audio.py @@ -43,13 +43,14 @@ class Audio: def stopRecord(self, play=True, save=False): print("* done recording") self.recordStream.stop_stream() - self.frames = [] if save: self._saveFile() if play: self._playFrames() + self.frames = [] + def _saveFile(self): wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb') wf.setnchannels(RESPEAKER_CHANNELS) @@ -61,6 +62,7 @@ class Audio: def _playFrames(self): print("* playing recorded audio") + print(self.frames) playbackStream = self.pyaudio.open( format=self.pyaudio.get_format_from_width(RESPEAKER_WIDTH),