Re: stereo channel splitting

Chris Robinson <[email protected]> Thu, 09 Aug 2012 20:26:34 -0700
Newsgroups gmane.comp.lib.openal
Message-ID <[email protected]>
On 08/09/2012 02:03 AM, Philipp Kraus wrote:
> On mono signals everything works fine and now I would like to add stereo
> support.
> I have found, that the i-th sample in the vector is the left channel and
> the (i+1)-th sample
> the right channel. Is this correct?

The samples are interlaced and alternate between left and right, yes. 0 
is left, 1 is right, 2 if left, 3 is right, etc.

> So if I have read my vector how can I seperate the left / right channel.

Separate in what way? Do you just need to address the channels 
individually, or do you actually need to deinterlace the samples (so 
left and right go into separate buffers)? If you just need to address 
the channels individually, you can do:

l_buffer[(sample*2) + 0]; // left
l_buffer[(sample*2) + 1]; // right

to read the left and right channels of the given sample.
_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal