Answer the question
In order to leave comments, you need to log in
How to output sound to two devices at the same time?
Audio devices are connected to the green socket of the integrated sound card.
You need to output sound at the same time using C# code.
What methods and libraries to use?
Answer the question
In order to leave comments, you need to log in
If all devices are connected to the same socket, then it is apparently enough to simply play the sound, in any convenient way.
More complex things can be done with NAudio for example .
var searcher = new System.Management.ManagementObjectSearcher("SELECT * FROM Win32_SoundDevice");
var devices = searcher.Get();
foreach (var device in devices)
{
Console.WriteLine(device.GetPropertyValue("Caption").ToString());
}
// ...
var waveReader = new NAudio.Wave.WaveFileReader(fileName);
var waveOut = new NAudio.Wave.WaveOut();
waveOut.DeviceNumber = deviceNumber;
var output = new NAudio.Wave.DirectSoundOut();
output = waveOut;
output.Init(waveReader);
output.Play();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question