Skip to content
Draft
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
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
# _find_library('sndfile') fails:
if sys.platform == 'win32':
architecture0 = architecture()[0] # 64bit or 32bit
if architecture0 == '64bit':
if 'arm' in machine().lower():
architecture0 = 'arm64'
else:
architecture0 = 'x64'
else:
architecture0 = machine() # x86_64 or arm64
architecture0 = machine()

if platform == 'darwin':
libname = 'libsndfile_' + architecture0 + '.dylib'
Expand Down
9 changes: 4 additions & 5 deletions soundfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,11 @@
elif _sys.platform == 'win32':
from platform import architecture as _architecture
from platform import machine as _machine
# this check can not be completed correctly: for x64 binaries running on
# arm64 Windows report the same values as arm64 binaries. For now, neither
# numpy nor cffi are available for arm64, so we can safely assume we're
# in x86 land:
if _architecture()[0] == '64bit':
_packaged_libname = 'libsndfile_x64.dll'
if _machine().lower() == 'arm64':
_packaged_libname = 'libsndfile_arm64.dll'
else:
_packaged_libname = 'libsndfile_x64.dll'
elif _architecture()[0] == '32bit':
_packaged_libname = 'libsndfile_x86.dll'
else:
Expand Down