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. Observing User inactivity time and broadcasting intent after timeout

Intent.ACTION_SCREEN_OFF is broadcast at the time where the user has been
inactive and the screen is about to turn off.




> 

2. Invalid View object passed to onListItemClick()?

Hi!
  I tested your code on my Hero and it work fine..No that error on Android
1.5!

--

3. How to add a new product project ?

4. Kernel panic occurs while Android is running

5. Invoking apps in background when phone starts

6. List of Intents related to Contact

7. Observing User inactivity time and broadcasting intent after timeout