3

Let us say I have an audio iPhone app which takes input from the microphone.

Now, although I haven't tried this myself, I believe the user could use an external microphone that plugs into the phonojack socket.

This means my audio unit could be receiving its input from the internal or the external microphone.

My guess is that iOS will automatically route from an external microphone if it is connected.

But what if I don't want that?

Is there a way to specify which microphone should be used?

I have looked in the audio session guide, I can find some setting regarding a Bluetooth headset. But that is as close as I can find. It appears that it is not possible. But I find that difficult to believe.

PS Also I am curious how it detects an external microphone... if I plug my headphones in, it should continue routing from the internal microphone. my headphones are just plain stereo headphones. but if I used my mobile phone's headphones ( on extra band on the Jack... they have a microphone built onto the cable where the individual earpiece strands meet ) I would expect it to pick up this source instead.

P i
  • 29,020
  • 36
  • 159
  • 267
  • this question is almost identical (but unresolved): http://stackoverflow.com/questions/4002133/forcing-iphone-microphone-as-audio-input – P i Jun 11 '11 at 02:06

1 Answers1

1

You have to use the AUHAL unit to set a specific input device as default input and then connect it with the AudioQueue.

Apple has a detailled Technical Note for that: Device input using the HAL Output Audio Unit

XcodeJunkie
  • 424
  • 4
  • 10