Hi,
I have created a subclass of AudioAppComponent and instanciated an AudioDeviceManager with my audio devices like so:
ProcessorHost() : AudioAppComponent(adm) {
AudioDeviceManager::AudioDeviceSetup deviceSetup = Config::getInstance()->getDeviceSetup();
std::cout << deviceSetup.inputDeviceName << " | " << deviceSetup.outputDeviceName << std::endl;
//returns "MacBook Air Mikrofon | MacBook Air-Lautsprecher" as these are the configured devices in deviceSetup.
adm.initialise(2, 2, nullptr, false, "", &deviceSetup);
setAudioChannels(adm.getCurrentAudioDevice()->getActiveInputChannels().countNumberOfSetBits(), adm.getCurrentAudioDevice()->getActiveOutputChannels().countNumberOfSetBits());
}
I know, that I can list all available INPUT and OUTPUT devices like this, where the bool-value in “getDeviceNames(bool)” indicates which type gets returned:
void ProcessorHost::listAvailableDevices() {
for (auto devicetype : adm.getAvailableDeviceTypes()) {
//INPUT devices
for (const auto& devicename : devicetype->getDeviceNames(true)) {
std::cout << devicename.toStdString() << std::endl;
}
//OUTPUT devices
for (const auto& devicename : devicetype->getDeviceNames(false)) {
std::cout << devicename.toStdString() << std::endl;
}
}
}
Great so far. I also know, that I can get the current selected OUTPUT-devicename from the AudioDeviceManager (in my case adm) like so:
adm.getCurrentAudioDevice()->getName(); // returns "MacBook Air-Lautsprecher"
But how do I get the current INPUT-devicename from the AudioDeviceManager? Maybe I am missing a bit from the docs, could someone please help?