问题
Apple guy tried to be funny and wrote in the docs:
("Headphone," "Speaker," etc.)
What kind of return values are possible in reality?
回答1:
He wasn't being funny, those are actual values. The only one I've seen that he didn't outline is "LineOut"
回答2:
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
回答3:
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.
回答4:
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.
回答5:
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)
回答6:
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
来源:https://stackoverflow.com/questions/2753562/what-kind-of-routes-could-i-get-back-from-kaudiosessionproperty-audioroute-prope