From 2df7dec44d9a3f12eb5b3aa96c48353937a335c8 Mon Sep 17 00:00:00 2001 From: talksik Date: Thu, 27 Apr 2023 14:43:13 -0700 Subject: [PATCH] more debug --- audio/audio.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/audio/audio.py b/audio/audio.py index 280d12b..98a0b25 100644 --- a/audio/audio.py +++ b/audio/audio.py @@ -62,7 +62,7 @@ class Audio: def _playFrames(self): print("* playing recorded audio") - print(self.frames) + print(len(self.frames)) playbackStream = self.pyaudio.open( format=self.pyaudio.get_format_from_width(RESPEAKER_WIDTH), @@ -73,11 +73,13 @@ class Audio: # loop through self.frames and play audio for frame in self.frames: - print("playing a frame") playbackStream.write(frame) + print("* done playing recorded audio") + # cleanup stuff playbackStream.stop_stream() + playbackStream.close() def terminate(self): self.pyaudio.terminate()