From d907a16edd2e133925ec038787a987e905638e85 Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 29 Apr 2023 16:11:07 -0700 Subject: [PATCH] cleanup --- mic_hat_examples/recording_examples/play.py | 12 ++++++------ mic_hat_examples/recording_examples/record.py | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mic_hat_examples/recording_examples/play.py b/mic_hat_examples/recording_examples/play.py index 0351390..950c4f4 100644 --- a/mic_hat_examples/recording_examples/play.py +++ b/mic_hat_examples/recording_examples/play.py @@ -17,11 +17,11 @@ wf = wave.open(sys.argv[1], 'rb') p = pyaudio.PyAudio() # 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(), - output = True, - output_device_index = RESPEAKER_INDEX) +stream = p.open(format=p.get_format_from_width(wf.getsampwidth()), + channels=wf.getnchannels(), + rate=wf.getframerate(), + output=True, + output_device_index=RESPEAKER_INDEX) # read data (based on the chunk size) data = wf.readframes(chunk) @@ -32,5 +32,5 @@ while data: data = wf.readframes(chunk) # cleanup stuff. -stream.close() +stream.close() p.terminate() diff --git a/mic_hat_examples/recording_examples/record.py b/mic_hat_examples/recording_examples/record.py index 5482948..7c95d16 100644 --- a/mic_hat_examples/recording_examples/record.py +++ b/mic_hat_examples/recording_examples/record.py @@ -25,7 +25,6 @@ frames = [] for i in range(0, int(RESPEAKER_RATE / CHUNK * RECORD_SECONDS)): data = stream.read(CHUNK) - print("read a chunk") frames.append(data) print("* done recording")