I am working on a VoIP app which allows user to select audio source when multiple outputs are available. It's just like the native phone app, when bluetooth speaker is connected, original "Speaker" icon will become "Bluetooth/Speaker" icon where you can select Phone/Speaker/Bluetooth..
After several failed attempts with AVAudioSession
, I found a workaround with MPVolumeView
. MPVolumeView
's route button allows users to select which device to play the sound.. Still, it's not an ideal solution... but I know somewhere in Apple's code, they do have methods to retrieve all available audio source and set a specific output.. I'm curious how this is done?
I know previously you can use Audio Session Services but this lib is deprecated in iOS7. And I could not find any method to retrieve available output sources from the alternative AVAudioSession
class...
I have been searching for this in the past few days and asked a few relevant questions.. still trying my luck :)