Bad .wav duration
See original GitHub issueHello!
First of all thank you guys for developing this amazing tool! I use it a lot and I come across one case where librosa somehow fails to determine correct file duration therefore fails to load it. I have a .wav file that is stereo track in 44100 kHZ, 32-bit float. In Audacity this file has 3 mins and 6.87 seconds length. When I do “librosa.get_duration(…” I get: 189.567
So that is off from original length by ~ 3 seconds. Now when I do “librosa.load(…” on that particular file I get an error:
File "/home/simanas/.virtualenvs/PhonicMind/local/lib/python2.7/site-packages/librosa/core/audio.py", line 150, in load
y = y.reshape((-1, n_channels)).T
ValueError: cannot reshape array of size 16394065 into shape (2)
But if I add duration=187 to librosa.load function then it all works good.
Here is the file that is giving this error: https://files.fm/u/j44v5jgc
Appreciate your help!
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How to get the duration of a .WAV file that is not supported by ...
I am writing a program to annotate .wav files, so I need to play them and to know their duration. I can use...
Read more >How to fix a WAVE file that will no longer play, has a length of ...
It depends what you want out of it. There's some good points about a wireless drive, and just as many (if not more)...
Read more >Fixing corrupted .wav files easily using the free VLC media ...
We had some problems after recording raw 4K footage, where the . wav sidecar file wouldn't import into video editing apps like Premiere...
Read more >Change the DURATION of Your MUSIC to any length Adobe ...
Get 10% off Unlimited Soundstripe Music for video with code: GAL10 ➡️ https://bit.ly/10offSoundStripe (My affiliate link) In this video ...
Read more >Fixing broken WAV files with SoX
Corrupted WAV files ... Many ways to fix these files involve opening it as RAW audio file in Audacity and ... sox --ignore-length...
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
Ah, also please use this Issue template: https://raw.githubusercontent.com/librosa/librosa/master/ISSUE_TEMPLATE.md
Ok thank you guys for your help. Really appreciate it!
I am not doing anything fancy, just simple get_duration function on file path, which gives me wrong duration. Yes I believe that this must be something related to that specific file, because I only got this issue with it, so it perfectly falls in that %5 category where things don’t appear to be working as expected.
Thank you for your help, this gave me a lot of info on how to address this. I feel like there is no need to keep this issue open, so I am closing it. 😃