[vorbis-dev] Questions, questions
Monty
xiphmont at xiph.org
Wed Oct 6 20:48:59 PDT 1999
> So, converting back to the canonical 16-bit little endian PCM... I have a
> few questions:
>
> The samples in the floats are linear, correct?
Yes. All the 16 bit formats in common use are linear.
> Will there always be two channels? If not, how do I find out how many
> channels there are?
No, Vorbis will do mono and 5.1 as well (at a minimum). vi->channels will hold
the number of channels (all the specifics of the audio will be in that struct).
> Should I just cast the char to a double?
That was a typo in the example I sent; it should be double **pcm (this is
corrected in the example source in CVS).
> I also suppose that I will have to check the host's byte order, for if it
> is big endian the samples will all have to be converted to little
> endian...
I'm not sure what the fastest way to convert float to a specific endian ordered
16 bit integer (I'm an algorithms specialist; I'm very good at handling
complexity order and optimization, but I'm not terribly cood at writing
tactically tight code). Perhaps Segher would have a suggestion?
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