bastibe / python-soundfile

SoundFile is an audio library based on libsndfile, CFFI, and NumPy
BSD 3-Clause "New" or "Revised" License
713 stars 109 forks source link

System Error when opening Wav File #227

Closed JSai23 closed 6 years ago

JSai23 commented 6 years ago

I keep getting this error message. Any help would be great! raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace')) RuntimeError: Error opening 'data/NSDTSEA/clean_testset_wav/p232_001.wav': System error.

bastibe commented 6 years ago

This often means "File not found". Are you sure that the path is correct?

JSai23 commented 6 years ago

Yes the path is correct for sure Im on windows

JSai23 commented 6 years ago

I dont know if that could be causing the problem

JSai23 commented 6 years ago

Traceback (most recent call last): File "main.py", line 169, in main() File "main.py", line 165, in main inference(config, cla) File "main.py", line 133, in inference clean_input = util.load_wav(cla.clean_input_path + filename, config['dataset']['sample_rate']) File "C:\Users\JSai\Documents\Cochlear_Implants\speech-denoising-wavenet\util.py", line 179, in load_wav sequence, sample_rate = read_wav(wav_path) File "C:\Users\JSai\Documents\Cochlear_Implants\speech-denoising-wavenet\util.py", line 166, in read_wav audio_signal, sample_rate = sf.read(filename) File "C:\Users\JSai\Anaconda3\envs\wavenet\lib\site-packages\soundfile.py", line 373, in read subtype, endian, format, closefd) as f: File "C:\Users\JSai\Anaconda3\envs\wavenet\lib\site-packages\soundfile.py", line 740, in init self._file = self._open(file, mode_int, closefd) File "C:\Users\JSai\Anaconda3\envs\wavenet\lib\site-packages\soundfile.py", line 1265, in _open "Error opening {0!r}: ".format(self.name)) File "C:\Users\JSai\Anaconda3\envs\wavenet\lib\site-packages\soundfile.py", line 1455, in _error_check raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace')) RuntimeError: Error opening 'data/NSDTSEA/clean_testset_wav/p232_001.wav': System error.

That is the full error traceback

JSai23 commented 6 years ago

Really Sorry, I wasn't reading the error correctly, when I extracted it created an extract folder with the files so in the end the path was wrong. THANK YOU SOOOO MUCH.

bastibe commented 6 years ago

No problem ;-)

lbxcfx commented 4 years ago

Don't create the output_timit by yourself

Vernadskii commented 3 years ago

For example in PyCharm check your working directory in configuration of interpreter

sighclone commented 3 years ago

I would like to know what the exact error is because I need to except the error as it is not an issue for me but excepting RuntimeError or SystemError excepts the error.

bastibe commented 3 years ago

You can see the error message in the traceback above. Otherwise, just try to open a nonexistent file.

sighclone commented 3 years ago

The errors mentioned my message previously are the only two errors presented! excepting both of them didn't work. Please let me know if you need more information.

bastibe commented 3 years ago

As far as Python is concerned, these are RuntimeError instances. The error messages are provided by libsndfile. This includes the "System Error" string. You can look up the exact error behavior in the libsndfile documentation.

Also note that this is not a commercial support line. If anyone here is helping you it is because you asked nicely, not because you "need" anything. Please refrain from acting entitled, and be as helpful as possible if you want our help.

sighclone commented 3 years ago

Please refrain from acting entitled, and be as helpful as possible if you want our help.

Did I come out rude? I'm sorry if that's the case, I absolutely didn't mean it! and also, yes, I'll look into the libsndfile documentation.

mk544 commented 2 years ago

Error opening 'LibriSpeech/LibriSpeech/train-other-500/1353/122456/1353-122456-0002.wav': System error.

I have this error while I have the file inside the folder also this is the whole error trace

RuntimeError Traceback (most recent call last) in () 2 pickle_path='model_0.pickle', 3 save_model_path='model_0.h5', ----> 4 spectrogram=True) # change to False if you would like to use MFCC features

8 frames /usr/local/lib/python3.7/dist-packages/soundfile.py in _error_check(err, prefix) 1355 if err != 0: 1356 err_str = _snd.sf_error_number(err) -> 1357 raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace')) 1358 1359

RuntimeError: Error opening 'LibriSpeech/LibriSpeech/train-other-500/1353/122456/1353-122456-0002.wav': System error.

bastibe commented 2 years ago

The file probably does not exist. Try opening the file with open() to make sure.

Bengt commented 1 year ago

For what it's worth, I was getting this error because I created a directory using WORKDIR in my Dockerfile, which was created without write permissions.

Problem:

WORKDIR /app
python soundfile_app.py

Solution:

WORKDIR /app
RUN chmod 777 /app
python soundfile_app.py
hammad93 commented 12 months ago

Another thing to try that worked for me is to check if your path is relative. I had a path like this, "~/filename.wav" which threw an error but when explicitly defining the full path, it worked.

dalaolili commented 11 months ago

I keep getting this error message. Any help would be great! raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace')) RuntimeError: Error opening 'data/NSDTSEA/clean_testset_wav/p232_001.wav': System error.

maybe you can try an absolute pathname, I replace the relative pathname with the absolute pathname, then I solve the ploblem!