Hello Jucers,
I’m tinkering with an example of JUCE’s GUI Application and having some trouble doing something that I assume should be doable. Say my app uses a 6-channel device as input and a 6-channel device as output. For both the input and output device, I was wondering if there’s a way to programmatically decide to enable only 5 of the 6 channels; more specifically, if I’d like to enable only channels 0,1,2,3,5 of both devices (i.e. skipping channel 4). Something like what I can manually do through the AudioDeviceSelectorComponent (the de-selected channels are Input and Output 5 in the image cause the numbering starts at 1)
Considering deviceManager
being an instance of AudioDeviceManager
defined in AudioAppComponent
, currentAudioSetup
defined as follows
AudioDeviceManager::AudioDeviceSetup currentAudioSetup;
and since setting some fields of currentAudioSetup
(inputDeviceName
, outputDeviceName
, bufferSize
, sampleRate
) like in the code below does work, I was hoping that assigning my channel configuration to the fields inputChannels
and outputChannels
of currentAudioSetup
, i.e.
currentAudioSetup.inputDeviceName = "JUCE_in_device";
currentAudioSetup.outputDeviceName = "JUCE_out_device";
currentAudioSetup.bufferSize = currBuffSize;
currentAudioSetup.sampleRate = currSampleRate;
currentAudioSetup.inputChannels = 101111;
currentAudioSetup.outputChannels = 101111;
deviceManager.initialise (currInChannelNum, currOutChannelNum, nullptr , true , {} , ¤tAudioSetup);
would work but it doesn’t seem to have an effect.
Any idea of what I’m doing wrong?