Well, the assumption is that you use it with VR. In the Oculus software you can set which audio device to use for regular VaM sound, so you can set it to something different that whatever your Windows default is.
If you want to be able to change the audio device within ConnectAudio, you can add something like this to the
StartAudio() method in
MainWindow.xaml.cs. Obviously you could also build UI and what not...but this is the quick and simple version:
C#:
private void StartAudio()
{
StopAudio();
int deviceNumber = -1;
for (int i = -1; i < WaveOut.DeviceCount; i++)
{
var caps = WaveOut.GetCapabilities(i);
if (caps.ProductName == "Speakers (Realtek(R) Audio)") // <--- run once to get devices names, then put your favorite device here and recompile
{
deviceNumber = i;
break;
}
}
Log.Message("Available audio devices:");
for (int i = -1; i < WaveOut.DeviceCount; i++)
{
var caps = WaveOut.GetCapabilities(i);
if (i == deviceNumber)
Log.Message($"{i}: {caps.ProductName} <= CHOOSEN");
else
Log.Message($"{i}: {caps.ProductName}");
}
WaveProvider waveProvider = new WaveProvider(myWaveManager);
myAudio = new WaveOutEvent();
myAudio.NumberOfBuffers = 2;
myAudio.DesiredLatency = 60;
myAudio.DeviceNumber = deviceNumber;
myAudio.Init(waveProvider);
myAudio.Play();
}