-
Notifications
You must be signed in to change notification settings - Fork 930
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
mp3 loading fails #945
Comments
Hello @nomota, please read this: https://github.com/librosa/librosa#audioread-and-mp3-support To fuel Note that on some platforms, If you are using Anaconda, install ffmpeg by calling
If you are not using Anaconda, here are some common commands for different operating systems:
For GStreamer, you also need to install the Python bindings with
|
The support text lostanlen shared unfortunately doesn't seem to work for Windows machines (or is missing key steps). Installation of the GStreamer binaries does not solve the issue, and the pip command to install pygobject elicits an error. At present, at least on Windows, it looks like Librosa can't parse MP3s. |
It definitely can, we include this in our windows platform continuous integration tests. If it's not working on your installation, there is a problem with the upstream decoding libraries (audioread -> ffmpeg). Be sure to follow the installation instructions carefully. |
That gives me some hope! Though I've been hitting my head against this problem for days, now, Are there installation instructions anywhere that I could "follow carefully" to install ffmpeg? The instructions above from the Librosa git only cover GStreamer, and, as noted, the required pip installation of pygobject generates an error (an enormous, multi-screen error, headed with "ERROR: Command errored out with exit status 1:" that Google has not helped with). If ffmpeg is a viable alternative to GStreamer for Windows, I haven't found installation instructions that have successfully helped it interface with Python. Just the usual instructions to download ffmpeg to a directory and add it to Windows Path. But when followed carefully, they still don't seem to affect my Librosa scripts' ability to parse MP3s. On your Windows tests, are you using ffmpeg rather than GStreamer? I feel like I've gotten better at untangling the various dependency knots across different Python versions, and managing installation of packages, but this has had me stymied for a while now (and I'm working with large enough file sets that I can't just convert them all to ogg to make them work)! |
Yes, the relevant parts of our Appveyor setup are the following: Lines 16 to 24 in 4b827ce
Lines 17-22 create the conda environment, line 23 installs ffmpeg via conda-forge, and line 24 installs the remaining dependencies needed for testing. Note that this is all from the main development branch. If you're using the packaged version, the following ought to suffice:
|
I'm getting this error even with ffmpeg installed via anaconda. Are there any other solutions?
|
y, sr = librosa.load("my.mp3")
Traceback (most recent call last):
File "/home/esperanto/anaconda3/lib/python3.6/site-packages/librosa/core/audio.py", line 127, in load
with sf.SoundFile(path) as sf_desc:
File "/home/esperanto/anaconda3/lib/python3.6/site-packages/soundfile.py", line 627, in init
self._file = self._open(file, mode_int, closefd)
File "/home/esperanto/anaconda3/lib/python3.6/site-packages/soundfile.py", line 1182, in _open
"Error opening {0!r}: ".format(self.name))
File "/home/esperanto/anaconda3/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 'my.mp3': File contains data in an unknown format.
Description
Steps/Code to Reproduce
Expected Results
Actual Results
Versions
Linux-4.4.0-17763-Microsoft-x86_64-with-debian-jessie-sid
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
[GCC 7.2.0]
NumPy 1.16.4
SciPy 1.1.0
librosa 0.7.0
The text was updated successfully, but these errors were encountered: