Skip to content

Commit 21675a5

Browse files
committed
Add Windows ARM64 wheel build support
1 parent 43dd824 commit 21675a5

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

.github/workflows/sounddevice-data.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ jobs:
1414
arch: 'x64'
1515
- os: windows-latest
1616
arch: 'x86'
17+
- os: windows-11-arm
18+
arch: 'arm64'
1719
runs-on: ${{ matrix.os }}
1820
steps:
1921
- name: Set up Python
2022
uses: actions/setup-python@v6
2123
with:
22-
python-version: "3.10"
24+
python-version: "3.13"
2325
architecture: ${{ matrix.arch }}
2426
- name: Double-check Python version
2527
run: |

make_dist.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ make_wheel Windows 32bit
1919

2020
make_wheel Windows 64bit
2121

22+
make_wheel Windows arm64
23+
2224
# This makes sure that the libraries are not copied to the final sdist:
2325
rm -rf sounddevice.egg-info/
2426

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

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

2223
if system == 'Darwin':
2324
libname = 'libportaudio.dylib'
@@ -52,7 +53,9 @@ def get_tag(self):
5253
if system == 'Darwin':
5354
oses = MACOSX_VERSIONS
5455
elif system == 'Windows':
55-
if architecture0 == '32bit':
56+
if architecture0 == 'arm64':
57+
oses = 'win_arm64'
58+
elif architecture0 == '32bit':
5659
oses = 'win32'
5760
else:
5861
oses = 'win_amd64'

sounddevice.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,17 @@
7474
if _platform.system() == 'Darwin':
7575
_libname = 'libportaudio.dylib'
7676
elif _platform.system() == 'Windows':
77-
if 'SD_ENABLE_ASIO' in _os.environ:
78-
_libname = 'libportaudio' + _platform.architecture()[0] + '-asio.dll'
77+
machine = _platform.machine().lower()
78+
if machine in ('arm64', 'aarch64'):
79+
if 'SD_ENABLE_ASIO' in _os.environ:
80+
_libname = 'libportaudioarm64-asio.dll'
81+
else:
82+
_libname = 'libportaudioarm64.dll'
7983
else:
80-
_libname = 'libportaudio' + _platform.architecture()[0] + '.dll'
84+
if 'SD_ENABLE_ASIO' in _os.environ:
85+
_libname = 'libportaudio' + _platform.architecture()[0] + '-asio.dll'
86+
else:
87+
_libname = 'libportaudio' + _platform.architecture()[0] + '.dll'
8188
else:
8289
raise
8390
import _sounddevice_data

0 commit comments

Comments
 (0)