I just spent 2 hours debugging, why audioread cannot find ffmpeg when everything else can see and access it.
It turned out, I was iterating over a directory and one of the files was not an audio file resulting in the NoBackendError, which is IMHO misleading. Could you please add a descriptive message to the exception? Something like "File xyz has a codec where no backend could be identified for".
Best,
Alex
[2020-02-04 14:58:34,366] ERROR in app: Exception on /upload [GET]
Traceback (most recent call last):
File "C:\anaconda\envs\msd_demo\lib\site-packages\flask\app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "C:\anaconda\envs\msd_demo\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\anaconda\envs\msd_demo\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\anaconda\envs\msd_demo\lib\site-packages\flask\_compat.py", line 39, in reraise
raise value
File "C:\anaconda\envs\msd_demo\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "C:\anaconda\envs\msd_demo\lib\site-packages\flask\app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "app.py", line 102, in upload
ap.convert_audio(f["path"])
File "C:\Work\Github\slychief\speechrec\audio_processing.py", line 48, in convert_audio
wave_data = load_audio(src_name)
File "C:\Work\Github\slychief\speechrec\audio_processing.py", line 44, in load_audio
wave_data, sample_rate = librosa.core.load(f_name, sr=SAMPLE_RATE, mono=True)
File "C:\anaconda\envs\msd_demo\lib\site-packages\librosa\core\audio.py", line 119, in load
with audioread.audio_open(os.path.realpath(path)) as input_file:
File "C:\anaconda\envs\msd_demo\lib\site-packages\audioread\__init__.py", line 116, in audio_open
raise NoBackendError()
audioread.exceptions.NoBackendError
Sure; a wording clarification would be good idea! I'd be happy to accept a pull request that does something like that (as long as it's backwards-compatible).
Hi,
I just spent 2 hours debugging, why audioread cannot find ffmpeg when everything else can see and access it.
It turned out, I was iterating over a directory and one of the files was not an audio file resulting in the NoBackendError, which is IMHO misleading. Could you please add a descriptive message to the exception? Something like "File xyz has a codec where no backend could be identified for".
Best, Alex