Reputation: 43
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?
Upvotes: 2
Views: 1068
Reputation: 54706
Looking at the documentation of AVAudioSessionCategoryMultiRoute
it states that (emphasis added by me)
The category for routing distinct streams of audio data to different output devices at the same time.
Meaning that you can only output different audio streams to different output channels. You cannot output the same audio stream to several channels.
As far as I'm concerned, there are no other methods to achieve playing the same audio stream on several channels either.
Upvotes: 1