11

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

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

What kind of return values are possible in reality?

dontWatchMyProfile
  • 45,440
  • 50
  • 177
  • 260

6 Answers6

11

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
l8nite
  • 5,042
  • 1
  • 20
  • 23
3

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

Jamie Pinkham
  • 336
  • 1
  • 4
2

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.

dnaxxx
  • 175
  • 1
  • 8
1

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.

broughten
  • 11
  • 1
  • I get the same (MicrophoneWired / MicrophoneBuiltIn) when I've used kAudioSessionCategory_RecordAudio as my audio category and I plug and unplug a headset (headphones with built-in mic). – Ben Clayton Aug 09 '12 at 16:18
0

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

FatalError
  • 574
  • 1
  • 7
  • 18
0

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)

Bill Phillips
  • 7,687
  • 1
  • 25
  • 13