Question

Apple guy tried to be funny and wrote in the docs:

("Headphone," "Speaker," etc.)

What kind of return values are possible in reality?

Was it helpful?

Solution

He wasn't being funny, those are actual values. The only one I've seen that he didn't outline is "LineOut"

OTHER TIPS

I ran 'strings' on the CoreMedia framework (iOS4.2 SDK), and the following strings seem reasonable and are grouped together:

  • ReceiverAndMicrophone
  • HeadsetInOut
  • HeadphonesAndMicrophone
  • SpeakerAndMicrophone
  • HeadsetBT
  • LineInOut
  • Default

Command was:

strings -a -o CoreMedia | less

# CoreMedia is from /Developer/Platforms/iPhoneOS.platform/Developer \
# /SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks/CoreMedia.framework

According to http://lists.apple.com/archives/coreaudio-api/2009/Jan/msg00084.html there are also LineOut, HeadsetInOut, ReceiverAndMicrophone, HeadphonesAndMicrophone, but the guy who asked whether there are more values received no answer.

I just got MicrophoneWired from it. (I actually have a special piece of hardware plugged in that is a temperature probe, but we are using it through the headphone jack).

Then I got MicrophoneBuiltIn with nothing plugged in. This is on an ipod touch with 4.3 by the way.

The values provided by l8nite above are reserved for when your audio session is configured for both input and output. Other values used when you're only doing audio out: (I used the same trick as l8nite - thanks!)

LineOut

HeadphonesBT (used for Bluetooth audio output - observed this hooked up to via bluetooth to a car audio system)

AirTunes (used for AirPlay output)

How is HeadphonesBT different from HeadsetBT ? My app could successfully use the HeadsetBT device to send and receive audio while HeadphonesBT failed to do anything. This is on iOs6

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top