java - Android Media Player accuracy -
i want make kind of karaoke app, need make ui changes @ particular moment (millisecond timing)
mediaplayer.getduration
is not same depending on device.
mediaplayer.getcurrentposition
gives me millisecond there not precision (it jump 200 millisecond 1 time 400 , on...)
so guys, how can accuracy want ? there audio player or audio player can use in java ?
thanks.
theoretically accuracy depend on:
1) how ask getcurrentposition()
. in cases use 100 ms interval.
2) media format use
3) , critical depend on implementation. part of hw , sw related multimedia vary device device , depend on device manufacturer, hw chips , os version.
i suggest try query current position more frequently. , different media files.
possible solution:
you can use software implementation of media player (ex: ffmpeg can compiled android). negative side of cpu usage, battery drain , video decoding speed. devices cannot handle (too low fps) huge high quality video without hw acceleration provided standard mediaplayer api.
Comments
Post a Comment