即使连接了 HDMI 适配器,是否可以通过耳机插孔强制音频?
我看到 iOS 5.0 现在有多个音频路由的常量:
const CFStringRef kAudioSessionOutputRoute_LineOut;
const CFStringRef kAudioSessionOutputRoute_Headphones;
const CFStringRef kAudioSessionOutputRoute_BluetoothHFP;
const CFStringRef kAudioSessionOutputRoute_BluetoothA2DP;
const CFStringRef kAudioSessionOutputRoute_BuiltInReceiver;
const CFStringRef kAudioSessionOutputRoute_BuiltInSpeaker;
const CFStringRef kAudioSessionOutputRoute_USBAudio;
const CFStringRef kAudioSessionOutputRoute_HDMI;
const CFStringRef kAudioSessionOutputRoute_AirPlay;
我还看到 iOS 5.0 支持一个名为 kAudioSessionProperty_OutputDestination 的新属性,它是读/写的:
kAudioSessionProperty_OutputDestination
A read/write CFNumberRef object that indicates the audio output destination, from a USB audio accessory attached through the iPad camera connection kit, that you want to use.
The value must be one of the identifiers provided as a kAudioSession_OutputDestinationKey_ID key as part of the kAudioSessionProperty_OutputDestinations array.
Available in iOS 5.0 and later.
问题:
- 该属性是否旨在让我强制输出路由?
- 文档提到了一个 USB 音频附件。当没有连接附件或连接 HDMI 电缆时,这是否有效?
- 是否有任何示例代码显示如何正确设置此属性?
谢谢!