summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2018-04-23 12:02:42 +0200
committerMatthias Geier <Matthias.Geier@gmail.com>2018-04-23 12:11:30 +0200
commit80036aa430a6498226d088ffb5dfbfdb7ce210a7 (patch)
treef4d3eee541c9c6b9023685ad3f72272b2a82246b
parente9106a8687c7b7ca179820d5771d88526e44cd20 (diff)
wire & rec_unlimited examples: Explicitly import NumPy
-rwxr-xr-xexamples/rec_unlimited.py2
-rwxr-xr-xexamples/wire.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/examples/rec_unlimited.py b/examples/rec_unlimited.py
index b8f448f..262ed40 100755
--- a/examples/rec_unlimited.py
+++ b/examples/rec_unlimited.py
@@ -38,6 +38,8 @@ args = parser.parse_args()
try:
import sounddevice as sd
import soundfile as sf
+ import numpy # Make sure NumPy is loaded before it is used in the callback
+ assert numpy # avoid "imported but unused" message (W0611)
if args.list_devices:
print(sd.query_devices())
diff --git a/examples/wire.py b/examples/wire.py
index 744d725..32d6ebe 100755
--- a/examples/wire.py
+++ b/examples/wire.py
@@ -31,6 +31,8 @@ args = parser.parse_args()
try:
import sounddevice as sd
+ import numpy # Make sure NumPy is loaded before it is used in the callback
+ assert numpy # avoid "imported but unused" message (W0611)
def callback(indata, outdata, frames, time, status):
if status: