Skip to content

Commit cc654c9

Browse files
committed
DOC: Rename status variables to cumulated_status
1 parent 70652e1 commit cc654c9

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

examples/spectrogram.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@
5757
fftsize = np.ceil(samplerate / delta_f).astype(int)
5858
low_bin = np.floor(low / delta_f)
5959

60-
statuses = sd.CallbackFlags()
60+
cumulated_status = sd.CallbackFlags()
6161

6262
def callback(indata, frames, time, status):
63-
global statuses
64-
statuses |= status
63+
global cumulated_status
64+
cumulated_status |= status
6565
if any(indata):
6666
magnitude = np.abs(np.fft.rfft(indata[:, 0], n=fftsize))
6767
magnitude *= args.gain / fftsize
@@ -87,8 +87,8 @@ def callback(indata, frames, time, status):
8787
print('\x1b[31;40m', usage_line.center(args.columns, '#'),
8888
'\x1b[0m', sep='', flush=True)
8989
break
90-
if statuses:
91-
logging.warning(str(statuses))
90+
if cumulated_status:
91+
logging.warning(str(cumulated_status))
9292
except KeyboardInterrupt:
9393
parser.exit('Interrupted by user')
9494
except Exception as e:

examples/wire.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
try:
2222
import sounddevice as sd
2323

24-
callback_status = sd.CallbackFlags()
24+
cumulated_status = sd.CallbackFlags()
2525

2626
def callback(indata, outdata, frames, time, status):
27-
global callback_status
28-
callback_status |= status
27+
global cumulated_status
28+
cumulated_status |= status
2929
outdata[:] = indata
3030

3131
with sd.Stream(device=(args.input_device, args.output_device),
@@ -37,8 +37,8 @@ def callback(indata, outdata, frames, time, status):
3737
print("#" * 80)
3838
input()
3939

40-
if callback_status:
41-
logging.warning(str(callback_status))
40+
if cumulated_status:
41+
logging.warning(str(cumulated_status))
4242
except KeyboardInterrupt:
4343
parser.exit('\nInterrupted by user')
4444
except Exception as e:

0 commit comments

Comments
 (0)