[Vorbis-dev] decoding vorbis bytes into floats
Ian Malone
ibmalone at gmail.com
Thu Oct 3 13:01:25 PDT 2013
On 3 October 2013 19:11, Andy Martin <zippo227 at gmail.com> wrote:
> On 10/3/13 12:09 AM, Gunter Königsmann wrote:
>> The last time I had I decode ogg the source code of oggdec did nearly read
>> like documentation. If I remember it right it basically ran a batch of
>> initialization functions from libogg and libvorbis (the first three packets
>> are the header containing the info that the file uses the vorbis codec, the
>> metadata and everything the vorbis codec needs to know in order to to decode
>> the data; Libogg's task is to divide the steam into packets). After the
>> decoder has been informed about the header it can decide any packet libogg
>> will output. You can even leave out any number of packets or throw in a
>> "end-of-file" packet followed by a new header at any time.
> Thank you for the information about what libogg is. Oggdec sounds
> interesting, but I don't think I can integrate command line tools into my
> project. I won't be encoding the audio but rather receiving it from icecast
> stream where I only have control of the Kbps of the steram.
I think what Gunter means is read the source code of oggdec (rather
than just use oggdec) to get an idea how to do this.
One thing from your original email: you talk about feeding bytes into
the decoder, what you actually feed in should be packets, which is
what you get out of the encapsulation layer (Ogg stream) and pull out
samples as they become available (usually, but not always, one packet
= multiple samples).
See:
http://www.xiph.org/ogg/doc/libogg/index.html
and
http://www.xiph.org/vorbis/doc/libvorbis/index.html
Particularly
http://www.xiph.org/ogg/doc/libogg/decoding.html
and the decoding vorbis section of
http://www.xiph.org/vorbis/doc/libvorbis/overview.html
--
imalone
http://ibmalone.blogspot.co.uk
More information about the Vorbis-dev
mailing list