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. find text in page

How do I find text within a page in the browser app?

I use this feature all the time on firefox and its even more important
to be able to search for text on a phone browser where you can only
see a small portion of a web page at a time...


2. Drawing a circle outline? (not a filled circle)


How can we draw a circle outline in an Overlay? I keep getting a
filled circle with the following code:

    Path outline = new Path();
    outline.addCircle(150, 150, 100, Path.Direction.CW);

    Paint paint = new Paint();

    canvas.drawPath(outline, paint);

I  was kind of expecting it to just be the outline of the circle, not


3. XMas presents

4. Any way to have two MediaRecorders recording at once?

5. Relative view size or fixed aspect ratio

6. Where to find Jarsigner

7. Does SoundPool work or has anyone successfully used it?