-
Notifications
You must be signed in to change notification settings - Fork 15
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
Dimension is different between lua---audio on librosa! #17
Comments
I have the same problem here. I use the following codes to read a mp3 with 44100 Hz, 192 kb/s: audio, sr = librosa.load(path, sr=None, Mono=False)
audio = audio[0] and
And that's what I got:
All I can do to keep it (nearly) align is drop the last slice of Librosa version As you can see that they are nearly the same, the third row is the difference, around Any thoughts about the reason? Thanks! |
@eborboihuc surprisingly you have very similar values. In my case, values are also differs a lot even thou I used the same file with same settings...But seems like your workaround pretty much solves the issue. However I'm also curious about the reason. Thanks. |
For the similar value part, I guess there might be some version issues or some setting issues between Librosa and Torch audio :( I use librosa 0.5.0 and audio-0.1-0. And my code setting is the same as above. |
@eborboihuc When i test both library with the voice.mp3 (example sound file in torch-audio), I get very similar values. And the dimension difference between two libraries is 576 for sr=22050. So your above example is based on only one file or did you get similar results for different files too? |
@ardasnck And for the voice.mp3, I only got 4.27 for the difference between them when sr=22050
|
@eborboihuc yes I can confirm this on my side for voice.mp3 file. However when I try different sound files (.mp3 extension), such as 02 - "Canon" (in D-Major), Pachebel from http://www.stephaniequinn.com/samples.htm, librosa.shape=(4010496,1) and lua.shape=(4013568,1) and values are different. Can you validate this on your side? |
I tried that one, got a big difference with original downloaded version. I now can have a considerably smaller difference after doing some conversion. I have tried several versions of combinations, and find out a rule of thumb: convert it. Here is what I do, and this can be easily solved by a simple command. sox input.mp3 output.mp3 trim 0 Below is the original
and After conversion,
and Hope this can answer your question. |
Thank you very much for your contribution Soumith.
When I read the same audio file (.mp3) with your library and 'librosa' in python, I get different size as an output.
Mono channel, sampling rate : 22050
lua---audio returns (417024x1)
librosa returns (417600x1)
Any idea what would be the reason?
Thank you very much.
The text was updated successfully, but these errors were encountered: