python-soundfile
python-soundfile copied to clipboard
raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening 'soundwave.wav': System error.
System error almost always means your file name is incorrect.
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?
May I ask if your problem has been resolved? I have also encountered the same problem.
Check if the folder exists where you are writing the file
检查写入文件的文件夹是否存在
I carefully checked the folder and confirmed that it exists
Can you open the same file name with open? Try converting it to an absolute path if it's relative.
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)
In the MockingBird project training encountered the same problem, how to solve
i solved it by moving wav file to the same directory where the python code is running
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.
Solved