Skip to content

Commit

Permalink
Based on an environ flag, load the ASIO PortAudio binary
Browse files Browse the repository at this point in the history
  • Loading branch information
arkrow committed Sep 4, 2024
1 parent a1b4fbc commit 2748f70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
libname = 'libportaudio.dylib'
elif system == 'Windows':
libname = 'libportaudio' + architecture0 + '.dll'
libname_asio = 'libportaudio' + architecture0 + '-asio.dll'
else:
libname = None

if libname and os.path.isdir('_sounddevice_data/portaudio-binaries'):
packages = ['_sounddevice_data']
package_data = {'_sounddevice_data': ['portaudio-binaries/' + libname,
'portaudio-binaries/README.md']}
if system == 'Windows':
package_data['_sounddevice_data'].append(
'portaudio-binaries/' + libname_asio)
zip_safe = False
else:
packages = None
Expand Down
5 changes: 4 additions & 1 deletion sounddevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@
if _platform.system() == 'Darwin':
_libname = 'libportaudio.dylib'
elif _platform.system() == 'Windows':
_libname = 'libportaudio' + _platform.architecture()[0] + '.dll'
if 'SD_ENABLE_ASIO' in _os.environ:
_libname = 'libportaudio' + _platform.architecture()[0] + '-asio.dll'
else:
_libname = 'libportaudio' + _platform.architecture()[0] + '.dll'
else:
raise
import _sounddevice_data
Expand Down

0 comments on commit 2748f70

Please sign in to comment.