Separating audio left and right

Alper Can Kat 20 Reputation points


I have two wav audio files.

I want to hear these two files separately from the left and right outputs of my headphone.

I have an attempt below but;

When the script runs, the sound of two files comes from the left and right channels, and the sound of one file is quieter but audible.

I want to completely separate the two audio files. For example, my test1.wav file should only play on the left headphone output.

I'm waiting for your help.

var input1 = new WaveFileReader("c:\deneme\test1.wav");

var input2 = new WaveFileReader("c:\deneme\test2.wav");

MultiplexingWaveProvider waveProvider = new MultiplexingWaveProvider(new IWaveProvider[] { input1, input2 }, 2);


WaveOut wave = new WaveOut();



My respects

Microsoft Technologies based on the .NET software framework.
2,303 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,453 questions
0 comments No comments
{count} votes

Accepted answer
  1. gekka 2,556 Reputation points MVP
    //using NAudio.Wave;
    var input1 = new WaveFileReader(path1);
    var input2 = new WaveFileReader(path2);
    var mono1 = new StereoToMonoProvider16(input1);
    var mono2 = new StereoToMonoProvider16(input2);
    var stereo1 = new MonoToStereoProvider16(mono1);
    stereo1.LeftVolume = 1;
    stereo1.RightVolume = 0;
    var stereo2 = new MonoToStereoProvider16(mono2);
    stereo2.LeftVolume = 0;
    stereo2.RightVolume = 1;
    var f1 = new Wave16ToFloatProvider(stereo1);
    var f2 = new Wave16ToFloatProvider(stereo2);
    var mix = new NAudio.Wave.MixingWaveProvider32(new IWaveProvider[] { f1, f2 });
    WaveOut wave = new WaveOut();
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful