In my app I am using the play and record category aka:
UInt32 sessionCategory = kAudioSessionCategory_PlayAndRecord;
CheckError( AudioSessionSetProperty (kAudioSessionProperty_AudioCategory,
sizeof (sessionCategory),
&sessionCategory), "Couldn't set audio category");
In the app any audio that plays would initially output through the receiver until I set this:
UInt32 doChangeDefaultRoute = 1;
AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof (doChangeDefaultRoute), &doChangeDefaultRoute);
What I actually want however is for audio to output through a connected bluetooth speaker. For example I have a speaker that I connect with via bluetooth. I am able to play music through it with the native music app. However in my app when using the playandrecord category it only plays on the device. I have tried:
UInt32 allowBluetoothInput = 1;
OSStatus stat = AudioSessionSetProperty (
kAudioSessionProperty_OverrideCategoryEnableBluetoothInput,
sizeof (allowBluetoothInput),
&allowBluetoothInput
);
As well as:
CFStringRef audioRouteOverride = kAudioSessionOutputRoute_BluetoothHFP;
OSStatus s = AudioSessionSetProperty (kAudioSessionProperty_OutputDestination,
sizeof(audioRouteOverride),&audioRouteOverride);
No luck. It seems as though this should be an easy property set but Idk. Any ideas?