resemble-ai / Resemblyzer

A python package to analyze and compare voices with deep learning
Apache License 2.0
2.79k stars 429 forks source link

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

Closed rubberbird closed 4 years ago

rubberbird commented 4 years ago

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 commented 4 years ago

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 commented 3 years ago

FIX by intalling ffmpeg.

Ubuntu: sudo apt install ffmpeg