python-soundfile icon indicating copy to clipboard operation
python-soundfile copied to clipboard

raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening 'soundwave.wav': System error.

Open AadeshLawange-Guardinger opened this issue 2 years ago • 7 comments
trafficstars

System error almost always means your file name is incorrect.

bastibe avatar Aug 27 '23 10:08 bastibe

System error almost always means your file name is incorrect.

I tried to change the name of the file, but the problem is still there. Could it be the sampling rate?

a897456 avatar Nov 13 '23 09:11 a897456

May I ask if your problem has been resolved? I have also encountered the same problem.

12345678-beep avatar Nov 18 '23 09:11 12345678-beep

Check if the folder exists where you are writing the file

检查写入文件的文件夹是否存在

I carefully checked the folder and confirmed that it exists

12345678-beep avatar Nov 18 '23 09:11 12345678-beep

Can you open the same file name with open? Try converting it to an absolute path if it's relative.

bastibe avatar Nov 18 '23 11:11 bastibe

sf.write(file_name, data, samplerate) Maybe the data is not right, numpy.ndarray with multiple dimensions.
such as '[[0,1,......]]' sf.write(file_name, data[0], samplerate)

SRbone avatar Feb 28 '24 07:02 SRbone

In the MockingBird project training encountered the same problem, how to solve

gaoyiyao avatar Apr 20 '24 07:04 gaoyiyao

i solved it by moving wav file to the same directory where the python code is running

gcbikram avatar Apr 23 '24 08:04 gcbikram

I also encountered this problem when I reproduced the paper. Specifically, when I loaded the training set, a piece of data could not be read successfully and the error was thrown at the same time. To my surprise, it worked successfully when I replaced the relative path of the data in the original file with an absolute path.

o-candy avatar May 16 '24 11:05 o-candy

Solved