Why is MediaPlayer.seekTo(int msec)
so inaccurate?
It's sometimes 30 seconds early (with mp3's of both variable and constant bitrates)! Is seeking with audio inherently problematic or is this method broken? Is it to do with buffering or what?
I've also noticed that the total runtime getDuration()
can be wrong (which isn't a big issue) and I've tested that getCurrentPosition()
is accurate enough (as in every n seconds of playback, it increases by n thousand). I'm on Android 2.2.
Finally, does anybody know which formats if any it actually works consistently for (preferably other than wav which presumably it does)?
EDIT:
I mainly listen to podcasts. smodcast and Thinking Allowed have been problematic several times, even after being converted/re-encoded to CBR. The files aren't corrupted.
QuickMediaConverter (Windows) seems to work ok but Sound Converter (Ubuntu) has generated some dodgy files. I'll try sticking to the former...
UPDATE: QuickMediaConverter works really well but no idea why. No problems since!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…