diff --git a/Classes/AudioHelper.m b/Classes/AudioHelper.m index dbc28f680..458aeb61f 100644 --- a/Classes/AudioHelper.m +++ b/Classes/AudioHelper.m @@ -11,7 +11,7 @@ @implementation AudioHelper + (NSArray *)bluetoothRoutes { - return @[ AVAudioSessionPortBluetoothA2DP, AVAudioSessionPortBluetoothLE, AVAudioSessionPortBluetoothHFP, AVAudioSessionPortCarAudio ]; + return @[AVAudioSessionPortBluetoothHFP, AVAudioSessionPortCarAudio, AVAudioSessionPortBluetoothA2DP, AVAudioSessionPortBluetoothLE ]; } + (AVAudioSessionPortDescription *)bluetoothAudioDevice { diff --git a/Classes/ProviderDelegate.m b/Classes/ProviderDelegate.m index 108f0c8c7..e046d0b5a 100644 --- a/Classes/ProviderDelegate.m +++ b/Classes/ProviderDelegate.m @@ -52,23 +52,20 @@ - (void)configAudioSession:(AVAudioSession *)audioSession { NSError *err = nil; [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord - withOptions:AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionAllowBluetoothA2DP + mode:AVAudioSessionModeVoiceChat + options:AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionAllowBluetoothA2DP error:&err]; if (err) { LOGE(@"Unable to change audio category because : %@", err.localizedDescription); err = nil; } - [audioSession setMode:AVAudioSessionModeVoiceChat error:&err]; - if (err) { - LOGE(@"Unable to change audio mode because : %@", err.localizedDescription); - err = nil; - } - double sampleRate = 44100.0; + + /*double sampleRate = 44100.0; [audioSession setPreferredSampleRate:sampleRate error:&err]; if (err) { LOGE(@"Unable to change preferred sample rate because : %@", err.localizedDescription); err = nil; - } + }*/ } - (void)reportIncomingCall:(LinphoneCall *) call withUUID:(NSUUID *)uuid handle:(NSString *)handle video:(BOOL)video; {