diff --git a/.github/workflows/sounddevice-data.yml b/.github/workflows/sounddevice-data.yml index 0736a06..02b8620 100644 --- a/.github/workflows/sounddevice-data.yml +++ b/.github/workflows/sounddevice-data.yml @@ -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: | diff --git a/_sounddevice_data/portaudio-binaries b/_sounddevice_data/portaudio-binaries index 0833256..bf2681c 160000 --- a/_sounddevice_data/portaudio-binaries +++ b/_sounddevice_data/portaudio-binaries @@ -1 +1 @@ -Subproject commit 083325660f3e002371213eef8f6a4bd579b647d6 +Subproject commit bf2681cd2c6c88c2ad83341049b2420d805d5353 diff --git a/make_dist.sh b/make_dist.sh index 4c4fe6e..93df602 100755 --- a/make_dist.sh +++ b/make_dist.sh @@ -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/ diff --git a/setup.py b/setup.py index 7f9cfb0..4d62639 100644 --- a/setup.py +++ b/setup.py @@ -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' @@ -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' diff --git a/sounddevice.py b/sounddevice.py index b486b00..bfa2dcb 100644 --- a/sounddevice.py +++ b/sounddevice.py @@ -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