[vorbis] Average Bitrate Calculation

Ross Levis ross at stationplaylist.com
Tue Oct 2 03:15:43 PDT 2001



Trick wrote:

  >>Ah, thanks Michael, that's what I needed.  In fact an easier way
  >>would be to simply read through the header packets until
  >>granulepos>0 and subtract the offset.
  >
  >Just if there's only comments in the beginning of the file ..
  >Comments can be all over the place. Remember cat =)

I didn't realise that.  I presume that the default is for comments at
the beginning so that's good enough for me.

I'm certainly no expert on audio formats but it seems that they all
suffer from lack of basic information at the start of the file.  It is very
inefficient to be jumping around thousands of files to obtain the length
(duration) of a playlist when the length of a song could simply be placed
at the beginning of the file after encoding.  Similarly with an average 
bitrate.  Only the Xing header for MP3 comes to mind as being efficient.

On a similar subject, is there an easy way of determining the number of bits
per second of the original PCM source.

Cheers,
Ross.

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list