Closed
Description
If I import a 24 bit AIFF in librosa, no exception is raised, but it is parsed as (I think?) a 16 bit WAV, resulting in an array of modulated white-ish noise.
This should be either an exception, or correctly load the file.
FWIW, I use subprocess calls to sox
and ffmpeg
to handle all non-WAVs, since audiorate
etc seem to also have problems with non-16-bit non-WAV files, and much of my data is in 24 or 32 bit formats.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
bmcfee commentedon Apr 30, 2016
Since librosa doesn't handle audio decoding directly, I think this is probably an issue in audioread.
Have you tried loading with PySoundFile instead? It will also load into a numpy array, so all of the other librosa functionality ought to work.
danmackinlay commentedon May 1, 2016
Wow, PySoundfile is a find. It does correctly load 24 bit audio. audioread does not.
to quote them:
It's a pity they don't throw an exception for non-16 bit audio, but that's not an issue for here.
Of course, libsoundfile doesn't support MP3, and presumably AAC etc for the same reason, so this would still leave a role for audioread. And if you then have a 24-bit MPEG4 audio file, neither library can do it; but once again, implementing universal audio support is not librosa's job.
bmcfee commentedon May 1, 2016
Yup, lack of mp3 support of the main reason we haven't switched over.
If there anything left to do in this thread, or can we close it out?