I'm simulating an incoming call notification by playing an audio file through AVAudioPlayer
. I wish to play the audio to both built-in speaker and connected bluetooth headset simultaneously.
I tried using AVAudioSessionCategoryMultiRoute
and AVAudioSessionCategoryPlayAndRecord
with AllowBluetooth category option selected.
For AVAudioSessionCategoryMultiRoute
, it is not able to detect the bluetooth device in available outputs.
For AVAudioSessionCategoryPlayAndRecord
, audio is routed to either bluetooth or speaker depending on the category option passed in while setting up the audio session category.
Is it possible to route the audio to both built-in speaker and bluetooth device simultaneously using AVAudioSession
API? Any code snippets, if available?