DSPRelated.com
Forums

Re: newbie question: separate a stereo sound into left and right channels

Started by tommylau.geo February 15, 2006
Hi Wei,

You should shift the bit to right side and make sure you are using th 
e correct data type during in the conversion.

leftChannel = (mySample & 0xFFFF0000) >> 16;
	--- In c6x@c6x@..., wei li <liwei2000@...> wrote:
>
> Dear List:
> 
> I have a question regarding AIC23 Codec on a C6713 board. I used the
> following command trying to get a sample of sound input from line 
in:
> 
> Uint32 mySample;
> DSK6713_AIC23_read(hCodec, &mySample);
> 
> which is successful. Then I try to use:
> 
> Uint16 leftChannel, rightChannel;
> leftChannel = mySample & 0xFFFF0000;
> rightChannel = mySample & 0x0000FFFF;
> 
> the resulting rightChannel gives the sterol sound while the 
leftChannel
> gives nothing.
> 
> How can I separate the two channels? Thanks very much in advance.
> 
> Wei
>