Separating stereo buffers in individual mono buffers


This is my first post in audacity. I have been using audacity a lot for all my android projects and now have come across a problem for which I need audio experts advice.
I have succinctly posted the problem here but couldn’t get any reply and reasons for that is Preety obvious as this should have been posted here.

Can anyone guide me in right direction?

Please let me know if I did any mistake in posting here.

Page Not Found
This question was voluntarily removed by its author.


I have moved the query to this place as this seems to be the right place to post audio related queries.

I think that it would be more relevant to an Android forum. As far as I can tell your question is about the Android sound system and really has nothing to do with Audacity.


I just wanted to know how does the audacity parses the raw pcm buffer and separate out left and right buffer?
I see the code in importPCM.cpp as below:

if (block) {
for(c=0; c<mInfo.channels; c++) {
if (mFormat==int16Sample) {
for(int j=0; j<block; j++)
((short *)buffer)[j] =
((short )srcbuffer)[mInfo.channelsj+c];
else {
for(int j=0; j<block; j++)
((float *)buffer)[j] =
((float )srcbuffer)[mInfo.channelsj+c];

channels[c]->Append(buffer, (mFormat == int16Sample)?int16Sample:floatSample, block);
From this i can see channel[0] will have left buffer and channel[1] will have right buffer. Is my understanding right i.e. alternate buffers 0, 2, 4, 6 will constitute left buffer and 1,3,5,7… is right buffer?
If my understsanding is right dumping channel[0] in audacity should show me only mono stream instead of stereo which is happening currently. Please guide me.

I now find the problem. Audacity goes by what you give as input i.e. in my case i was giving number of channels as 2 so probably that was the reason it was just displaying two channels with same mono data right? I have just one more question is that my separated out buffer size is 892kb but stereo buffer size is 1.73MB but both are playing for 10.313 seconds.How is this possible?