views:

112

answers:

2

When I stream music using the MediaPlayer, it gives me the wrong song duration. Has anyone else encountered this? Work around tips appreciated.

A: 

you will have to read the file until you get the id3 tag. If it's id3v2 you won't have much trouble but if it's id3v1 you may have to download the whole file.

here is how you can search for the range header.

http://stackoverflow.com/questions/869989/get-image-dimensions-with-curl/2597990#2597990

androidworkz
A: 

The duration was correct. I was misled because I was seeking before the song had finished loading - so after the seek it appeared that the music played longer than the actual duration.

Jason Van Anden