[Vorbis-dev] Fwd: Newbie q: decoupling vorbis from ogg

Ralph Giles giles at xiph.org
Wed Sep 14 12:26:31 PDT 2005


On Wed, Sep 14, 2005 at 11:49:39AM -0700, Nathaniel Gray wrote:

> Sorry if this is a newbie question.  I'm trying to write an OS X
> AudioCodec for Vorbis using libvorbis.  I'm confused about the
> libvorbis dependency on libogg.  I thought the vorbis spec didn't
> require ogg as the container, but the libvorbis API requires ogg data
> structures in various synthesis layer functions like
> vorbis_synthesis_headerin.  Is this library only intended to be used
> with ogg containers or is there a way to use it without ogg?

Yes, this is a little confusing. The Ogg container definitely not 
required, but libogg implements "more" than just container support.
While libvorbis does not require that the packets it creates/consumes
come from an Ogg container, it does use the libogg bitpacker internally, 
This code is shared among many of our codecs, and libogg seems a 
reasonable place to put it.

Further, libvorbis uses the ogg_packet structure defined by the libogg 
api for handling the compressed data packets. This is just for 
convenience, since most applications do use Vorbis with the Ogg 
container. It also fills out the granulepos field properly, which
is tedious and better not left to the caller.

So there is a code dependency, but not a format dependency. Hope that
clarifies the situation.

 -r


More information about the Vorbis-dev mailing list