This project has moved and is read-only. For the latest updates, please go here.

How to split one mixed audio file to two separate files

Sep 28, 2010 at 8:08 AM

Hi all,

Is it possible to use NAudio lib to split one mixed audio file to two separate files of left channel and right channel?

I have been working on this for the whole day and have not found a way yet...

Any suggestion?

Thanks a lot!




Sep 28, 2010 at 11:35 AM

it is possible to use NAudio as the basis for this, but you would need to create your own WaveStream that thre away every other sample


Sep 28, 2010 at 11:41 AM

Thank you Mark, I will try it.

Sep 29, 2010 at 2:42 AM

Hi Mark,

I read the wavestream class, it seems this class only for reading wave file, right?

Basically I want to generate two files of left channel recording and right channel recording respectively.

My real case is: I need to record phone calls, and now I can use the NAudio to get caller and receiver's voice in one wave file by using:

waveIn.WaveFormat = new WaveFormat(8000, 2);

A strange thing is when I listen to the recording audio, one side is only caller's voice, another side is the voice mixed from both caller and receiver.. I don't understand why..

Can you please give some tips? 

Thanks a lot:)


Oct 5, 2010 at 8:18 PM

the byte array you receive from waveIn will consist of 2 bytes left channel, 2 bytes right channel and so on. So you just throw away every other pair of bytes.

Also, when writing to the WaveFile, make sure that you set a mono format, i.e. new WaveFormat(8000,1);



Oct 5, 2010 at 9:54 PM

Thanks a lot Mark, I thought its 4 bytes for each...and failed to split them.