I am developing application in which there is a list of some audio files. When I click on a item it plays the corresponding audio and also shows the duration. The problem is in android 2.1 device and emulator the duration is correct but in android 2.2 emulator it’s showing wrong duration. Does anyone have idea to solve the problem. Is there a good method to get the correct duration of the sound files. The audio files are in the res/raw folder. And one thing for the same sounds iphone is showing correct duration.
Share
Yes
It is probably due to VBR files. Variable bit rates mention a rate in the header, which is probably used by Android software to calculate the duration of the MP3 from it’s length.
I remember having seen a utility that can calculate a ‘correct’ effective bitrate and prefix a separate MP3 data frame at the start just to make it report the ‘correct’ (average) bitrate.
Try VBRFix
It is also in the repositories for Ubuntu (Debian likely):
sudo apt-get install vbrfix