I'm sure this is a stupidly trivial question, but could someone please 
tell me how you determine the length of an audio file in seconds 
(without actually playing the file)? I just can't seem to find it from 
the code & docs.

The first 'stream' returned by a Demuxer's streams property (after it's 
"parse" method has been called with some data) contains a field called 
'length', but it's always negative, eg (from a .MP3):

Streams:
({'bitrate': 0,
   'block_align': 0,
   'channels': 0,
   'frame_rate': 25,
   'frame_rate_base': 1,
   'height': 0,
   'id': 86016,
   'index': 0,
   'length': -2077252342,
   'sample_rate': 0,
   'type': 1,
   'width': 0},)




-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Pymedia-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pymedia-users

Reply via email to