0 Replies
      Latest reply on May 15, 2020 3:10 PM by shadlx
      shadlx Level 1 Level 1 (0 points)

        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