How to use multiple channels of audio hardware?


#1

As in the title…I’ve tried :

engine.getDeviceManager().setWaveOutChannelsEnabled(
			{
				{0, AudioChannelSet::left},
				{1, AudioChannelSet::right},
				{2, AudioChannelSet::leftSurround},
				{3, AudioChannelSet::rightSurround},
			},true);

But I am not sure if that is even close to correct to achieve it…


#2

Surely the engine at least supports routing audio somehow to different hardware output channels, even if no explicit support for surround sound is available? Or how else would doing stereo headphone monitoring mixes or using external effects gear work…?


#3

You shouldn’t need to use this at all. The DeviceManager is initialised with 512, 512 input/output channels by default.

I think you just need to enable the additional devices:

for (int i = 0; i < deviceManager.getNumWaveOutDevices(); ++)
{
    if (auto waveOutputDevice = deviceManager.getWaveOutDevice (i))
        waveOutputDevice->setEnabled (true);
}

Does that help?