Skip to content

Commit 80036aa

Browse files
committed
wire & rec_unlimited examples: Explicitly import NumPy
1 parent e9106a8 commit 80036aa

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

examples/rec_unlimited.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def int_or_str(text):
3838
try:
3939
import sounddevice as sd
4040
import soundfile as sf
41+
import numpy # Make sure NumPy is loaded before it is used in the callback
42+
assert numpy # avoid "imported but unused" message (W0611)
4143

4244
if args.list_devices:
4345
print(sd.query_devices())

examples/wire.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def int_or_str(text):
3131

3232
try:
3333
import sounddevice as sd
34+
import numpy # Make sure NumPy is loaded before it is used in the callback
35+
assert numpy # avoid "imported but unused" message (W0611)
3436

3537
def callback(indata, outdata, frames, time, status):
3638
if status:

0 commit comments

Comments
 (0)