Skip to content

Commit 9bd46dc

Browse files
committed
Raise a meaningful exception if PortAudio is not found
1 parent 2f8bc04 commit 9bd46dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sounddevice.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@
5959

6060

6161
try:
62-
_lib = _ffi.dlopen(_find_library('portaudio'))
62+
_libname = _find_library('portaudio')
63+
if _libname is None:
64+
raise OSError('PortAudio library not found')
65+
_lib = _ffi.dlopen(_libname)
6366
except OSError:
6467
if _platform.system() == 'Darwin':
6568
_libname = 'libportaudio.dylib'

0 commit comments

Comments
 (0)