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

I play an mp3 file broadcast from the network in my application, some mp3 files have strange behavior: mediaPlayer.getCurrentPosition()more than mediaPlayer.getDuration()at the end, about 3 seconds.

CBR mp3 files are encoded.

What could be the reason for this?

+6
source share
2 answers

Finally, having solved the problem by converting mp3 files, this is the command I use:

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

+5
source

There are several reasons why you can get this behavior.

, mp3 44100Hz, , -, MediaPlayer , , .

Joint Stereo L/R Stereo. , , , , . , Forced L/R Stereo , Joint.

soxi, sox ( ffmpeg), , , .

mp3 , - , xml-, .

mp3 , , ( , , ), . , , , ExoPlayer, . MediaPlayer api, .

, , , , , . 3 , , .

+2

Source: https://habr.com/ru/post/1016721/


All Articles