Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do record audio from a bluetooth headset on the iPad/iPhone?

I can hear audio from bluetooth headsets on my iPad/iPhone, but I can't record audio in Applications from the headset. Even the sample "SpeakHere" application doesn't record audio from the headset.

Is there a reason audio out works seamlessly but audio in doesn't work? I'm trying to use an Aleph Jawbone headset.

like image 270
MikeN Avatar asked Jan 27 '11 08:01

MikeN


1 Answers

By default audio sessions don't support audio input via a bluetooth headset. It has to be explicitly accounted for in the code (which isn't true for bluetooth audio output).

That probably explains why lots of apps you're trying aren't supporting your headset: the developers haven't considered the edge case. The SpeakHere example code provided by Apple also doesn't support Bluetooth input (nice if it did, right?).

Here's the sample code Apple give in the docs to enable bluetooth input (assuming you already have an audio session):

UInt32 allowBluetoothInput = 1;

AudioSessionSetProperty (
    kAudioSessionProperty_OverrideCategoryEnableBluetoothInput,
    sizeof (allowBluetoothInput),
    &allowBluetoothInput
);

Hope that helps!

like image 132
lxt Avatar answered Sep 20 '22 22:09

lxt