I am trying to perform STFT on a bunch of sound files and I get this error. The path of the files which I am trying to perform STFT is correct but still, I get this error.
Make sure that your .wav
file is not corrupted. Can you open the file with an audio file reader (which can read wav files)? If not, your file is corrupted. If you downloaded the audio files from an opensource dataset, it is possible that they are corrupted while you are manually unzipping the folder. I'd recommend you download the dataset again and unzip it with a command-line tool.
This error can occur when Librosa cannot load the file, mainly because librosa cannot read the file format (for example mp3 format) and it tries to look for other backends like ffmpeg. So, installing ffmpeg may help in resolving this problem. Also, depending on the OS you use, you may have to add ffmpeg to the OS path in some cases. If the issue is in fact due to the file format, proper installation of ffmpeg may resolve the issue.