diff options
| author | Matthias Geier <Matthias.Geier@gmail.com> | 2018-02-27 12:06:57 +0100 |
|---|---|---|
| committer | Matthias Geier <Matthias.Geier@gmail.com> | 2018-03-11 11:45:36 +0100 |
| commit | 5eb00412f6bd54cbcd9dc16fd5544b73b52bac4f (patch) | |
| tree | 28a0543bcd7b601141a00211f95649da67f01e36 | |
| parent | b4de7fdad00d6a9013f3a324f9c1a8ba2e8abb8b (diff) | |
Try to load the PortAudio DLL from conda-forge
| -rw-r--r-- | sounddevice.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sounddevice.py b/sounddevice.py index 8b23c21..c9c8117 100644 --- a/sounddevice.py +++ b/sounddevice.py @@ -59,8 +59,14 @@ from _sounddevice import ffi as _ffi try: - _libname = _find_library('portaudio') - if _libname is None: + for _libname in ( + 'portaudio', # Default name on POSIX systems + 'bin\\libportaudio-2.dll', # DLL from conda-forge + ): + _libname = _find_library(_libname) + if _libname is not None: + break + else: raise OSError('PortAudio library not found') _lib = _ffi.dlopen(_libname) except OSError: @@ -71,8 +77,9 @@ except OSError: else: raise import _sounddevice_data - _lib = _ffi.dlopen(_os.path.join(next(iter(_sounddevice_data.__path__)), - 'portaudio-binaries', _libname)) + _libname = _os.path.join( + next(iter(_sounddevice_data.__path__)), 'portaudio-binaries', _libname) + _lib = _ffi.dlopen(_libname) _sampleformats = { 'float32': _lib.paFloat32, |
