NeilMortonNet
NeilMortonNet

Reputation: 1530

iPhone Objective C Bluetooth Hands Freed Audio Increase 8000 sample rate

I am looking at the HFP in iOS.

If I use code as follows (yes I am aware this was deprecated at iOS7), audio played via the bluetooth is at an 8000 sample rate.

UInt32 audioCategory = kAudioSessionCategory_PlayAndRecord;

AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (audioCategory), &audioCategory);

UInt32 allowBluetoothInput = 1;
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, sizeof(allowBluetoothInput), &allowBluetoothInput);

Is there any way when using the HFP to force a sample rate of 44100? I have looked at the following but this didn't change it.

Float64 preferredSampleRate = 44100.0;
AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareSampleRate, sizeof(preferredSampleRate), &preferredSampleRate);

Is there anyway to override this? It appears that the output sample rate is being reduced to the input sample rate of 8000.

Thanks.

Upvotes: 0

Views: 646

Answers (1)

jaket
jaket

Reputation: 9341

HFP supports 8kHz sample rate with the CVSD codec. As of HFP 1.6 it supports 16kHz "wideband speech" with the mSBC codec. I'm not sure if it is possible to override the rate since it is something which is negotiated between the hands-free device and the audio gateway (iPhone).

Upvotes: 2

Related Questions