即使连接了HDMI附件,是否可以强制AVAudioSession输出到耳机插孔?

时间:2011-10-26 18:59:00

标签: ios avfoundation avaudiosession audiosession hdmi

即使连接了HDMI adatper,是否可以通过耳机插孔强制音频?

我看到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.

问题:

  1. 该属性是否旨在让我强制输出路线?
  2. 文档提到USB音频配件。当没有连接配件或连接HDMI电缆时,这是否有效?
  3. 是否有示例代码显示如何正确设置此属性?
  4. 谢谢!

0 个答案:

没有答案