I'm using media player and I need to query current position once a 50ms interval, however, getCurrentPosition
seems to be updated only once a second or so if I play .ogg
format. Here is extract from the log:
05-16 13:29:28.551 9275-9275/com.some.app D/highlight﹕ Current position is: 0
05-16 13:29:28.603 9275-9275/com.some.app D/highlight﹕ Current position is: 1014
05-16 13:29:28.651 9275-9275/com.some.app D/highlight﹕ Current position is: 1014
05-16 13:29:28.703 9275-9275/com.some.app D/highlight﹕ Current position is: 1014
...
05-16 13:29:29.343 9275-9275/com.some.app D/highlight﹕ Current position is: 1014
05-16 13:29:29.391 9275-9275/com.some.app D/highlight﹕ Current position is: 1014
05-16 13:29:29.443 9275-9275/com.some.app D/highlight﹕ Current position is: 1014
05-16 13:29:29.491 9275-9275/com.some.app D/highlight﹕ Current position is: 1014
05-16 13:29:29.543 9275-9275/com.some.app D/highlight﹕ Current position is: 2033
05-16 13:29:29.595 9275-9275/com.some.app D/highlight﹕ Current position is: 2033
05-16 13:29:29.643 9275-9275/com.some.app D/highlight﹕ Current position is: 2033
...
05-16 13:29:30.555 9275-9275/com.some.app D/highlight﹕ Current position is: 3037
05-16 13:29:30.623 9275-9275/com.some.app D/highlight﹕ Current position
But when I use .mp3
format the position is updated once in 20 ms or so, which works for me:
05-17 05:45:04.459 5132-5144/com.some.app D/highlight 104
05-17 05:45:04.475 5132-5144/com.some.app D/highlight 104
05-17 05:45:04.479 5132-5144/com.some.app D/highlight 104
05-17 05:45:04.491 5132-5144/com.some.app D/highlight 131
05-17 05:45:04.499 5132-5144/com.some.app D/highlight 131
05-17 05:45:04.511 5132-5144/com.some.app D/highlight 131
05-17 05:45:04.519 5132-5144/com.some.app D/highlight 157
05-17 05:45:04.535 5132-5144/com.some.app D/highlight 157
05-17 05:45:04.539 5132-5144/com.some.app D/highlight 157
05-17 05:45:04.555 5132-5144/com.some.app D/highlight 157
05-17 05:45:04.559 5132-5144/com.some.app D/highlight 183
05-17 05:45:04.575 5132-5144/com.some.app D/highlight 183
05-17 05:45:04.579 5132-5144/com.some.app D/highlight 183
05-17 05:45:04.595 5132-5144/com.some.app D/highlight 183
I'm going to use mp3
now but I'm wondering why the difference, in case I'd need to use .ogg
how can I get the same udpate rate?