Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/sounddevice-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ jobs:
arch: 'x64'
- os: windows-latest
arch: 'x86'
- os: windows-11-arm
arch: 'arm64'
runs-on: ${{ matrix.os }}
steps:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version: "3.13"
architecture: ${{ matrix.arch }}
- name: Double-check Python version
run: |
Expand Down
2 changes: 2 additions & 0 deletions make_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ make_wheel Windows 32bit

make_wheel Windows 64bit

make_wheel Windows arm64

# This makes sure that the libraries are not copied to the final sdist:
rm -rf sounddevice.egg-info/

Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

# environment variables for cross-platform package creation
system = os.environ.get('PYTHON_SOUNDDEVICE_PLATFORM', platform.system())
machine = platform.machine().lower()
architecture0 = os.environ.get('PYTHON_SOUNDDEVICE_ARCHITECTURE',
platform.architecture()[0])
'arm64' if machine in ['arm64', 'aarch64'] else platform.architecture()[0])

if system == 'Darwin':
libname = 'libportaudio.dylib'
Expand Down Expand Up @@ -52,7 +53,9 @@ def get_tag(self):
if system == 'Darwin':
oses = MACOSX_VERSIONS
elif system == 'Windows':
if architecture0 == '32bit':
if architecture0 == 'arm64':
oses = 'win_arm64'
elif architecture0 == '32bit':
oses = 'win32'
else:
oses = 'win_amd64'
Expand Down
8 changes: 6 additions & 2 deletions sounddevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,14 @@
if _platform.system() == 'Darwin':
_libname = 'libportaudio.dylib'
elif _platform.system() == 'Windows':
if _platform.machine().lower() in ('arm64', 'aarch64'):
_platform_suffix = 'arm64'
else:
_platform_suffix = _platform.architecture()[0]
if 'SD_ENABLE_ASIO' in _os.environ:
_libname = 'libportaudio' + _platform.architecture()[0] + '-asio.dll'
_libname = 'libportaudio' + _platform_suffix + '-asio.dll'
else:
_libname = 'libportaudio' + _platform.architecture()[0] + '.dll'
_libname = 'libportaudio' + _platform_suffix + '.dll'
else:
raise
import _sounddevice_data
Expand Down
Loading