diff options
| author | Matthias Geier <Matthias.Geier@gmail.com> | 2016-12-19 17:32:28 +0100 |
|---|---|---|
| committer | Matthias Geier <Matthias.Geier@gmail.com> | 2016-12-19 17:33:12 +0100 |
| commit | d5511cbe29b952ee8311ad4b0a473cc2bc581b10 (patch) | |
| tree | 07605bc574932967f2fa09cec1e88f765f3b2cdd /examples/wire.py | |
| parent | b728182025874ba4293a7a4405fd61a3fdaa4da2 (diff) | |
Examples: Don't use the logging module, proper exit codes
Diffstat (limited to 'examples/wire.py')
| -rwxr-xr-x | examples/wire.py | 9 |
1 files changed, 2 insertions, 7 deletions
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: |
