[vorbis-dev] encoding question

David Maass tharos at t-link.de
Mon Dec 16 08:56:42 PST 2002



Thank you Mike
now after I know what the example is doing there and knowing where to look
in oggenc source things are getting much clearer.

Nice mailinglist, fast and friendly answers :)

From: <msmith at labyrinth.net.au>
> In a wav file, the channels are interleaved. Since it's 16 bits, that's
two
> bytes per sample. So, denoting a byte belonging to the left channel with a
0,
> and one from the right with a 1, the bytes look like:
> 001100110011, etc. 4 bytes for each left+right sample.
>
> This code un-interleaves them, because libvorbis wants seperate buffers
for
> left and right, and then converts them to floats (with a range of -1 to
1),
> since again that's required by the library.
>
> So, this is fine for stereo/16 bit/little endian (any sample rate, not
just
> 44100), but doesn't work for others.
>
> There are quite a few cases to handle, the exact details are boring and
> difficult to describe without giving source, so...
> Oggenc implements this in wav_read (in audio.c). You'll notice that there
are
> quite a few different cases, each handled individually - any number of
> channels, 8 or 16 bit, big or little endian. That function should be
> reasonably clear.

<p>--- >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-dev-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-dev mailing list