读取WAV文件时出现RuntimeError

时间:2019-06-25 13:48:44

标签: python runtime-error readfile system-error

我正在关注https://github.com/mravanelli/SincNet库。我已按照建议遵循文档。但是我遇到了RuntimeError

我已使用sudo chmod +x /home/sathiyakugan/Downloads/TIMIT/data/lisa/data/timit/raw/TIMIT更改了文件访问权限,但不能解决问题。

这是我执行的语法 python3 TIMIT_preparation.py /home/sathiyakugan/Downloads/TIMIT/data/lisa/data/timit/raw/TIMIT /home/sathiyakugan/Documents/FYP/out data_lists/TIMIT_all.scp

这是我收到的错误。

  File "TIMIT_preparation.py", line 56, in <module>
    [signal, fs] = sf.read(wav_file)
  File "/home/sathiyakugan/.local/lib/python3.6/site-packages/soundfile.py", line 257, in read
    subtype, endian, format, closefd) as f:
  File "/home/sathiyakugan/.local/lib/python3.6/site-packages/soundfile.py", line 627, in __init__
    self._file = self._open(file, mode_int, closefd)
  File "/home/sathiyakugan/.local/lib/python3.6/site-packages/soundfile.py", line 1182, in _open
    "Error opening {0!r}: ".format(self.name))
  File "/home/sathiyakugan/.local/lib/python3.6/site-packages/soundfile.py", line 1355, in _error_check
    raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
RuntimeError: Error opening '/home/sathiyakugan/Downloads/TIMIT/data/lisa/data/timit/raw/TIMIT/train/dr1/fvmh0/si1466.wav': System error.

1 个答案:

答案 0 :(得分:-1)

仔细检查该路径是否存在权限问题或输入错误。 SoundFile模块会打开与当前文件夹无关的文件,但需要该文件的绝对路径。