From d5511cbe29b952ee8311ad4b0a473cc2bc581b10 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Mon, 19 Dec 2016 17:32:28 +0100 Subject: Examples: Don't use the logging module, proper exit codes --- examples/wire.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'examples/wire.py') diff --git a/examples/wire.py b/examples/wire.py index ad9e3a5..2863b71 100755 --- a/examples/wire.py +++ b/examples/wire.py @@ -31,11 +31,9 @@ args = parser.parse_args() try: import sounddevice as sd - cumulated_status = sd.CallbackFlags() - def callback(indata, outdata, frames, time, status): - global cumulated_status - cumulated_status |= status + if status: + print(status, flush=True) outdata[:] = indata with sd.Stream(device=(args.input_device, args.output_device), @@ -46,9 +44,6 @@ try: print('press Return to quit') print('#' * 80) input() - - if cumulated_status: - logging.warning(str(cumulated_status)) except KeyboardInterrupt: parser.exit('\nInterrupted by user') except Exception as e: -- cgit v1.2.3