From b619b341d1ee190729d196d447060eef972ccf26 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Wed, 15 Dec 2021 11:33:07 +1030 Subject: [PATCH] wait until output buffer empties before finishing --- test/001_highsnr_stdio_audio/test_tx.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/001_highsnr_stdio_audio/test_tx.py b/test/001_highsnr_stdio_audio/test_tx.py index e30c015e..2b1c0c9f 100644 --- a/test/001_highsnr_stdio_audio/test_tx.py +++ b/test/001_highsnr_stdio_audio/test_tx.py @@ -155,7 +155,9 @@ for i in range(1,N_BURSTS+1): sys.stdout.flush() -# and at last check if we had an openend pyaudio instance and close it -if AUDIO_OUTPUT_DEVICE != -1: +# and at last check if we had an opened pyaudio instance and close it +if AUDIO_OUTPUT_DEVICE != -1: + time.sleep(stream_tx.get_output_latency()) + stream_tx.stop_stream() stream_tx.close() p.terminate()