[vorbis-dev] Header

Monty xiphmont at xiph.org
Thu May 11 03:17:51 PDT 2000



> 1. Will a standard MP3 decoder find 'sync' in an .OGG file?

No.  There is no commonality between the Ogg bitstream format and mp3.  Any
byte matches would be purely accidental (and probably impossible, as Ogg does
have 'magic' bytes to lead off).

> 2. Is there a simple header with bitrate information etc.
> encoded in
> the header? 

Yes.  Vorbis has three header packets; an initial small header uniquely 
identifying Vorbis (as opposed to some other Ogg type) and a few basic 
settings alone in the first Ogg bistream page.  The second and third packets 
contain text comments (eg, artist, title) and the full bitstream setup 
respectively.

> If someone could let me know of a doc with info
> on
> the header, I'd really appreciate it. I need info like
> bitrate, sample rate,
> embedded song name, artist name (if there is one, I sure
> hope so!)
> and I'll probably include all information that OGG stores
> about the
> file in my database.

Docs are incomplete; rather, the docs for the Ogg bitstream structure are
there, but not yet the Vorbis stream type.  It's not complicated, just not
written.

However, the Vorbisfile lib gives you all the functionality you mentioned 
right now.  I'll give more details tomorrow (I'm just about to head off to 
sleep).

> 3. I heard OGG supports variable bitrate. Is there an easy
> way to calculate
> the average bitrate? For MP3 files, I calculate average
> bitrate on my site
> by dividing file size by playtime etc.

That's a perfectly good way to do it.  Vorbisfile will also give you average 
bitrate, as well as maximum and minimum rates (if they're set/bounded; that's 
optional).

Monty

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/



More information about the Vorbis-dev mailing list