简体   繁体   English

iOS SDK-iPhone音频插孔如何与连接的电缆相互作用?

[英]iOS SDK - how the iphone audio jack interacts with the attached cable?

I seem to be getting several values from kaudiosessionproperty_audioroute property on the iPhone. 我似乎从iPhone的kaudiosessionproperty_audioroute属性获得了几个值。 Such as : 如 :

ReceiverAndMicrophone
HeadsetInOut
HeadphonesAndMicrophone
SpeakerAndMicrophone

How does the iPhone (iPod?) know what property to choose? iPhone(iPod?)如何知道要选择什么属性? What does each property mean on the perception of the microphone on the iPhone? 每个属性对iPhone上的麦克风的感知意味着什么?

Many Thanks! 非常感谢!

The key to understanding this is knowing what the words mean. 理解这一点的关键是知道单词的含义。 I don't know of a good dictionary in the docs, but some of the definitions are scattered through the docs (including the Audio Session Programming Guide ). 我不知道文档中有什么好的字典,但是其中一些定义分散在文档中(包括《 音频会话编程指南》 )。 Others, you just need to know how headsets work. 其他人,您只需要知道耳机的工作方式即可。

  • Receiver: "the small speaker you hold to your ear when on a phone call" 接收器:“打个电话时您会听到的小扬声器”
  • Headset: A 3-conductor plug in the headset jack (Left, Right, Microphone + Ground). 耳机:耳机插孔中的3芯插头(左,右,麦克风+地面)。
  • Headphones: A 2-conductor plug in the headset jack (Left, Right + Ground) 耳机:耳机插孔中的2芯插头(左,右+接地)
  • Microphone: The iPhone's microphone (at the base of the unit) 麦克风:iPhone的麦克风(位于设备底座上)
  • Speaker: The iPhone's "loud" speaker (at the base of the unit) 扬声器:iPhone的“扬声器”(位于设备底部)

So if you've plugged in "headphones" (earbuds with no microphone), that's HeadphonesAndMicrophone . 因此,如果您插入了“ headphones”(没有麦克风的耳塞),那就是HeadphonesAndMicrophone ReceiverAndMicrophone vs. SpeakerAndMicrophone is a software configuration setting (eg pressing the "Speaker" button in Phone.app). ReceiverAndMicrophoneSpeakerAndMicrophone是一种软件配置设置(例如,按下Phone.app中的“扬声器”按钮)。

You can tell how many conductors are on a headset jack by looking at the black bands that separate the channels. 通过查看分隔通道的黑带,可以知道耳机插孔上有多少根导线。 A stereo headphone jack has two black bands. 立体声耳机插孔有两个黑带。 A headset jack (with microphone) has three. 耳机插孔(带麦克风)有3个。 This is how the device can tell which one is plugged in. It just checks for continuity between one of the audio channels and the microphone input. 这就是设备辨别插入哪个设备的方式。它只是检查音频通道之一和麦克风输入之间的连续性。 If there's a short, then that means it's a headphone. 如果有短路,那就意味着它是耳机。 If it's open, then it's a headset. 如果它是开放的,那么它是头戴式耳机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM