From 5d598166d4c0d5753aeaa62c9fd9cae08433f387 Mon Sep 17 00:00:00 2001 From: Bastian Bechtold Date: Thu, 2 Jan 2025 16:45:40 +0100 Subject: [PATCH] x64 fixed, when running on arm64 Windows x64 python, running on arm64 Windows, reports the exact same architecture and platform as arm64 python running on arm64 Windows. We can not distinguish between them here. For now, neither, numpy nor CFFI support arm64 python on Windows, so we can simply ignore it. This is ugly. --- soundfile.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/soundfile.py b/soundfile.py index 5e201dd..d04bdcf 100644 --- a/soundfile.py +++ b/soundfile.py @@ -158,9 +158,11 @@ elif _sys.platform == 'win32': from platform import architecture as _architecture from platform import machine as _machine - if _machine() == 'ARM64': - _packaged_libname = 'libsndfile_arm64.dll' - elif _architecture()[0] == '64bit': + # 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' elif _architecture()[0] == '32bit': _packaged_libname = 'libsndfile_x86.dll'