AVAudioEngine selecting inputs/outputs

Hello


I am attempting to use an AVAudioEngine to mix a microphone feed with a track. I need the user to be able to select which input device to use (if they have more than one microphone attached), and which output device to use (headphones/speaker/something else)


I have been able to change the default output device by using engine.outputNode.auAudioUnit.setDeviceId(xx) as long as I do not instantiate the engine.inputNode.


It appears that - unless I use the system default input and output - I am only able to change the input and output nodes to a single device which must have both inputs and outputs. Changing the device on one node appears to also change the device on the other and so an error is thrown when you attempt to start the engine if the device does not have both inputs and outputs available.


Is anyone able to advise whether this is intended behaviour? It's clearly possible to have different devices on the inputs and outputs as that is the default state of the engine - but is this some internal magic inside the machine??


Any ideas would be gratefully appreciated!


Thanks


Richard