zero duration for some media

by Peter Jeffe » Thu, 09 Apr 2009 04:13:44 GMT

Sponsored Links
 Some audio files return 0 from MediaPlayer.getDuration(), even though
they're perfectly valid files that play ok and that players on Windows
can find the duration of.

There seem to be two different cases here: certain file types such
as .wma and .wav always return 0 duration, and others only do so
sometimes.  I haven't been able to find any pattern in the latter
case, but it does seem consistent per file.

The music player displays 0:00 duration for these, so it's not just my
code.  Any ideas on what's causing this and whether there's a
workaround?  Thanks.

-- Peter


zero duration for some media

by l hx » Thu, 09 Apr 2009 20:00:45 GMT

 today, i found this matter. and i see some code and found that the duration
of the file such as wma and wmv in the datebase is also 0. i will go on it.
who know why and how to solve, please give some advise.


Sponsored Links

zero duration for some media

by Peter Jeffe » Mon, 13 Apr 2009 07:34:46 GMT

 Hey Dave Sparks, any comment on this?  I understand that wma decoding
isn't handled by opencore, but that doesn't really answer why the
scanner shouldn't get durations from the codec through a standard
interface.  But my main concern is why do I get 0 duration from mp3s,
m4as, oggs, etc.?  To repeat, these are perfectly valid files that
play OK, and from which other media players can grok the duration.
It's a pretty big problem, so any ideas?  Thanks!

-- Peter


Other Threads

1. listview with different xml for rows

Hi all i want to implement listview with uses different xml layouts
for rows depending on underlying item. A non optimal solution will be
int getView method just to inflate every time a new view depending on
the item from the adapter. Is there a better way to do this ?


2. wifi is not disconnecting in suspend mode

HI All

I heard that when phone goes to suspend mode, wifi should disconnect
and after we again press the power button then it should connect.

This is not happening in my phone.

is there any reason for this? where i need to lookin to this issue?



3. Support for Atheros AR300x serial chip in Android kernel

4. is there a way to implement screenshot functionality in android

5. Adding permission in framework.

6. Reading SIM Card ID and Phone number from SIM Card

7. What is the maximum length for text datatype in SQLite?