Search code examples
androidaudioandroid-mediaplayer

mediaPlayer.getCurrentPosition() > mediaPlayer.getDuration() at the end of playing mp3 file


I'm playing mp3 file streamed from the network in my application, some mp3 files has weird behavior: mediaPlayer.getCurrentPosition() is larger than mediaPlayer.getDuration() at the end, for about 3 seconds.

The mp3 files are CBR encoded.

What might be the reason of this?


Solution

  • Finally solved the problem by converting the mp3 files, this is the command I'm using:

    lame --mp3input -t -m s -b 128 --cbr input.mp3 output.mp3