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

How to set specific volume for each Wave Out

Sep 1, 2014 at 11:56 AM
Hi ,
I have merged two songs and played at the same time using wave out.
If i want to set the volume for each song differently how i can set the volume.
im putting all the wave out objects in the list and when i try to set volume whole system volume changes. how i can the volume for specific wave out
Following is the code
   var sound1 = new Mp3FileReader(path);
            var waveOut = new WaveOut();
            waveOut.Init(sound1); waveOut.Play();
   var sound2 = new Mp3FileReader(path2);
            var waveOut = new WaveOut();
            waveOut.Init(sound2); waveOut.Play();
Sep 1, 2014 at 12:16 PM
Edited Sep 1, 2014 at 12:16 PM
  • create a VolumeWaveProvider for each chain (passing sound<X> in the constructor of each of them).
  • pass the VolumeWaveProviders to the .Init() functions
-> you put a volume control in between the source (= reader) and the playback destination

now you can usethe volume property of the VolumeWaveProviders to control playback volume of the single streams independently

Sep 1, 2014 at 12:27 PM
Can you please write some code there respective to my code or give me link of example
Sep 1, 2014 at 2:43 PM
just check the code at the end of this topic: Directsoundout set volume
...its a similiar problem...