PaddleSpeech icon indicating copy to clipboard operation
PaddleSpeech copied to clipboard

wav file import problem

Open BerkYxvuz opened this issue 2 years ago • 4 comments

audio_file_path = '17973-2-0-32.wav' librosa_audio_data, librosa_sample_rate = librosa.load(audio_file_path)

`--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) File ~\anaconda3\envs\tensorflow2\lib\site-packages\soundfile.py:161 159 raise OSError('no packaged library for this platform') --> 161 import _soundfile_data # ImportError if this doesn't exist 162 _path = _os.path.dirname(_soundfile_data.file) # TypeError if file is None

ModuleNotFoundError: No module named '_soundfile_data'

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last) File ~\anaconda3\envs\tensorflow2\lib\site-packages\soundfile.py:171 170 raise OSError('sndfile library not found using ctypes.util.find_library') --> 171 _snd = _ffi.dlopen(_libname) 173 except OSError: 174 # Try explicit file name, if the general does not work (e.g. on nixos)

OSError: cannot load library 'C:\Users\beek6\anaconda3\envs\tensorflow2\Library\bin\sndfile.dll': error 0x7e

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last) Cell In[4], line 2 1 audio_file_path = '17973-2-0-32.wav' ----> 2 librosa_audio_data, librosa_sample_rate = librosa.load(audio_file_path)

File ~\anaconda3\envs\tensorflow2\lib\site-packages\lazy_loader_init_.py:77, in attach..getattr(name) 75 submod_path = f"{package_name}.{attr_to_modules[name]}" 76 submod = importlib.import_module(submod_path) ---> 77 attr = getattr(submod, name) 79 # If the attribute lives in a file (module) with the same 80 # name as the attribute, ensure that the attribute and not 81 # the module is accessible on the package. 82 if name == attr_to_modules[name]:

File ~\anaconda3\envs\tensorflow2\lib\site-packages\lazy_loader_init_.py:76, in attach..getattr(name) 74 elif name in attr_to_modules: 75 submod_path = f"{package_name}.{attr_to_modules[name]}" ---> 76 submod = importlib.import_module(submod_path) 77 attr = getattr(submod, name) 79 # If the attribute lives in a file (module) with the same 80 # name as the attribute, ensure that the attribute and not 81 # the module is accessible on the package.

File ~\anaconda3\envs\tensorflow2\lib\importlib_init_.py:127, in import_module(name, package) 125 break 126 level += 1 --> 127 return _bootstrap._gcd_import(name[level:], package, level)

File :1030, in _gcd_import(name, package, level)

File :1007, in find_and_load(name, import)

File :986, in find_and_load_unlocked(name, import)

File :680, in _load_unlocked(spec)

File :850, in exec_module(self, module)

File :228, in _call_with_frames_removed(f, *args, **kwds)

File ~\anaconda3\envs\tensorflow2\lib\site-packages\librosa\core\audio.py:10 7 import pathlib 8 import warnings ---> 10 import soundfile as sf 11 import audioread 12 import numpy as np

File ~\anaconda3\envs\tensorflow2\lib\site-packages\soundfile.py:192 190 _snd = _ffi.dlopen(_os.path.join(_hbrew_path, _explicit_libname)) 191 else: --> 192 _snd = _ffi.dlopen(_explicit_libname) 194 libsndfile_version = _ffi.string(_snd.sf_version_string()).decode('utf-8', 'replace') 195 if libsndfile_version.startswith('libsndfile-'):

OSError: cannot load library 'libsndfile.dll': error 0xc1`

BerkYxvuz avatar Jun 17 '23 13:06 BerkYxvuz

OSError: cannot load library 'libsndfile.dll': error 0xc1`

没有安装正确,看下win怎么安装libsndfile吧。

zh794390558 avatar Jun 25 '23 06:06 zh794390558

I downloaded after than delete, all files, and problem absoluved.

BerkYxvuz avatar Jun 29 '23 13:06 BerkYxvuz

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 17 '23 10:09 stale[bot]

This issue is closed. Please re-open if needed.

stale[bot] avatar Apr 27 '25 21:04 stale[bot]

This issue is closed. Please re-open if needed.

stale[bot] avatar Jun 27 '25 03:06 stale[bot]