2017-02-07 6 views
0

私はAVAudioRecorderがthis answerによるとブルートゥースヘッドセットから録音できることを知っていますが、AVAudioRecorderはリアルタイムのオーディオデータを取得できません。ios:Bluetoothヘッドセットからオーディオキューを使用して録音する方法は?

私は、を使用して、オーディオキューを使用し、セッションのカテゴリとプロパティをdidFinishLaunchingWithOptionsメソッドで言及されているように設定しますが、動作しません。もし誰かが私に助けを与えてくれれば、とても感謝しています。

答えて

1

didFinishLaunchingWithOptionsメソッドに設定できないという問題が見つかりました。メソッドAudioSessionInitializeの後に呼び出す必要があります。

//Enable Bluetooth headset input 
UInt32 allowBluetoothInput = 1; 
OSStatus statBluetoothInput = AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, 
                  sizeof (allowBluetoothInput), 
                  &allowBluetoothInput); 

//Enable Speaker output 
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; 
OSStatus statSpeakerOutput = AudioSessionSetProperty (
                  kAudioSessionProperty_OverrideAudioRoute, 
                  sizeof (audioRouteOverride), 
                  &audioRouteOverride); 
関連する問題