File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 12
12
13
13
import os as _os
14
14
import sys as _sys
15
+ from platform import machine as _machine
15
16
from os import SEEK_SET , SEEK_CUR , SEEK_END
16
17
from ctypes .util import find_library as _find_library
17
18
from _soundfile import ffi as _ffi
159
160
while not _os .path .isdir (_path ):
160
161
_path = _os .path .abspath (_os .path .join (_path , '..' ))
161
162
162
- _snd = _ffi .dlopen (_os .path .join (
163
- _path , '_soundfile_data' , _libname ))
163
+ # Homebrew on Apple M1 uses a `/opt/homebrew/lib` instead of
164
+ # `/usr/local/lib`. We are making sure we pick that up.
165
+ if _sys .platform == 'darwin' and _machine () == 'arm64' :
166
+ _snd = _ffi .dlopen (_os .path .join (
167
+ '/opt/homebrew/lib/' , _libname ))
168
+ else :
169
+ _snd = _ffi .dlopen (_os .path .join (
170
+ _path , '_soundfile_data' , _libname ))
164
171
165
172
__libsndfile_version__ = _ffi .string (_snd .sf_version_string ()).decode ('utf-8' , 'replace' )
166
173
if __libsndfile_version__ .startswith ('libsndfile-' ):
You can’t perform that action at this time.
0 commit comments