This project has moved. For the latest updates, please go here.

How to set specific volume for each Wave Out

Sep 1, 2014 at 10: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 11:16 AM
Edited Sep 1, 2014 at 11:16 AM
  • 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

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