libsndfile (soundfile) for mp3 not float32 but float64
See original GitHub issueIs your feature request related to a problem? Please describe. Audio out from libsndfile (soundfile) for mp3 not float32 but float64. Because of this, if we do not force the dtype=float64 , we get an empty array
Describe the solution you’d like Maybe it makes sense to add a check for mp3 and change the dtype for the soundfile to float64 in this case? In file https://github.com/librosa/librosa/blob/main/librosa/core/audio.py
Additional context
if isinstance(path, tuple(audioread.available_backends())):
# Force the audioread loader if we have a reader object already
y, sr_native = __audioread_load(path, offset, duration, dtype)
else:
# Otherwise try soundfile first, and then fall back if necessary
try:
y, sr_native = __soundfile_load(path, offset, duration, dtype) <----------------- here also make check fro mp3 type
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Issues · bastibe/python-soundfile - GitHub
SoundFile is an audio library based on libsndfile, CFFI, and NumPy - Issues ... libsndfile (soundfile) for mp3 not float32 but float64.
Read more >SoundFile — PySoundFile 0.10.3post1-1-g0394588 ...
Usually two-dimensional (frames x channels), but one-dimensional data can be used for mono files. Only the data types 'float64' , 'float32' , 'int32'...
Read more >Newest 'soundfile' Questions - Stack Overflow
I am making a simple software which reads a map of events from a json file and creates sound based off of it....
Read more >pysndfile Documentation - Read the Docs
By default, when clipping is off, libsndfile uses slightly different scaling factors when reading pcm format into float samples, or when writing ...
Read more >Week 7 Class 2 CS 312 Audio Programming Winter 2020
MP3 files can be as much as one tenth the size of the WAV file. ... for more accurate internal computation but later...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for confirming. I’ll close this out, as it’s an upstream issue.
@magicse as stated above, I don’t think this is our bug to fix (if it is a bug). I would suggest to try reading from soundfile directly with the specified dtype. I expect you’ll find the same behavior.
Also, please use the issue template and fill out all fields. This information is helpful to maintainers for diagnosing issues, and it really does not require much effort from your side.