About switching right input /output device

Hi, jules
How are you?
I meet some trouble when switching devices.
When switching device,
First, I prepare the audioDeviceSetup struct.
for inputdevicename and outputdevicename.
I use directsound and asio devices. Is any requirement for this input / output pairs? for example, if I use Asio input device, shall I use directSound output device at the same time? or should use the same physical device as input and output ?

Then I use setAudioDeviceSetup() to set current device.

const String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup, const bool treatAsChosenDevice)

I got error return from this function. return
"No such device: " + newInputDeviceName;

I got the devicename by using AudioIODeviceType::getDeviceNames().
So the devicename should be right.

I am not able to figure it out, and could you please give me some ideas?

Cheers!
Leon

Yes, you can’t mix and match different device APIs! The device names obviously both have to be from the list given by the currently selected type, (maybe I need to make that more clear in the help)

Hi, jules
Thanks!
We can not mix devices with different type. Is it system restriction or juce lib’s restriction .
For example, I attach a device(ASIO) to computer as recording input, and want use speaker(directSound)as output from computer.
juce lib does not support it. is that correct?

Cheers!
Leon

That’s correct. It’s not a “restriction” though - it’s because I haven’t attempted to write something to solve the almost impossible task of running two unsynced devices and making them appear as a single, synced device…

Hi, jules
Thank. That makes sense.
I have another question. If I only provide a deviceName, how can I specify its deviceType?

I am not able to find the functions to do it.

Cheers!
Leon

Hi, jules
How are you?
If I choose ASIO toneport ux1 as input device, which device shall I set to output Device?
I set ASIO toneport ux1 as output device and it is not working.
What shall I set the output device for ASIO device?

I use types[1]->hasSeparateInputsAndOutputs() as condition to set up output device.
if it is true , I set the audioDeviceSetup.outputDeviceName = audioDeviceSetup.inputDeviceName.
if it is false, I pick up a outputDevice from the same type.

Is this right? I still get the error that can not set the outputDevice.

any ideas?
Leon

Maybe see what the juce audio selector component lets you do, and that might make it clearer.