How can I play sound on two different audio devices? (headphones and speakers of my pc)

1

I wish that, when an event is launched in my application, a sound will be reproduced both in an earphone (if I have it connected) and in the speakers of my pc. I was testing with WaveOut but it did not work. Thanks

    
asked by Renato 16.06.2016 в 21:51
source

1 answer

1

The path you were taking with the WaveOut is correct, maybe what you would be missing is to define the property DeviceNumber

How to play sound on many devices at the same time

Play a sound in a specific device with C #

 var waveOut = new WaveOut();
 waveOut.DeviceNumber = deviceNumber;
 WaveStream waveReader = new WaveFileReader(fileName);

 waveOut.Init(waveReader);
 waveOut.Play();

I would also recommend you take a look at NAudio

Send sound to different audio devices

uses example suando several audio libraries and take into account the output device

    
answered by 16.06.2016 / 23:30
source