Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error opening 'audio_data/test.mp3' : file containers data in an unknown format #27

Closed
rubberbird opened this issue May 3, 2020 · 2 comments

Comments

@rubberbird
Copy link

rubberbird commented May 3, 2020

Attempting to run demo02 but running into this error,

Error opening 'audio_data/test.mp3' : file containers data in an unknown format

"raise RuntimeError(prefix + _ffi.string(err_str).decode('urf-8), 'replace')

I have reinstalled and ensured librosa was up to date and install ffmpeg just in case. Still no luck? Is this me or a bug?

warnings.warn('PySoundFile failed. Trying audioread instead.')
Traceback (most recent call last):
File "/home/user/.local/lib/python3.6/site-packages/librosa/core/audio.py", line 129, in load
with sf.SoundFile(path) as sf_desc:
File "/home/usre/.local/lib/python3.6/site-packages/soundfile.py", line 629, in init
self._file = self._open(file, mode_int, closefd)
File "/home/user/.local/lib/python3.6/site-packages/soundfile.py", line 1184, in _open
"Error opening {0!r}: ".format(self.name))
File "/home/usre/.local/lib/python3.6/site-packages/soundfile.py", line 1357, in _error_check
raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
RuntimeError: Error opening 'audio_data/testaudio.mp3': File contains data in an unknown format.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./demo02_diarization.py", line 17, in
wav = preprocess_wav("audio_data/testaudio.mp3")
File "/home/user/voice-recog/Resemblyzer/resemblyzer/audio.py", line 27, in preprocess_wav
wav, source_sr = librosa.load(str(fpath_or_wav), sr=None)
File "/home/user/.local/lib/python3.6/site-packages/librosa/core/audio.py", line 162, in load
y, sr_native = __audioread_load(path, offset, duration, dtype)
File "/home/user/.local/lib/python3.6/site-packages/librosa/core/audio.py", line 186, in __audioread_load
with audioread.audio_open(path) as input_file:
File "/home/user/.local/lib/python3.6/site-packages/audioread/init.py", line 116, in audio_open
raise NoBackendError()

@rubberbird
Copy link
Author

Seems like I didn't install ffmpeg properly.

The following worked - Centos 7

sudo yum install epel-release
sudo rpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
sudo yum install ffmpeg ffmpeg-devel

@Aqua-4
Copy link

Aqua-4 commented May 29, 2021

  • librosa can't read mp3 files directly so it tries to use the audioread package.
  • Audioread tries to utilise a number of different packages that may or may not be installed. One of those is ffmpeg.

FIX by intalling ffmpeg.

Ubuntu:
sudo apt install ffmpeg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants