4

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 :)

Neeku
  • 3,646
  • 8
  • 33
  • 43
xialin
  • 7,686
  • 9
  • 35
  • 66
  • I have a similar problem. I need to direct audio to a bluetooth device if available. However mine is an Adobe Air application so I need to do the iOS Bluetooth part as a native extension which I understand means I can't use any UI classes like MPVolumeView. Did you get any further with this? – Buzzwig Jan 28 '14 at 11:16
  • do you want to allow users to select the output or set output according to priority automatically? I couldn't find a way of allowing manually select without using MPVolumeView. but if it's automatic, you can do it by setting allowBluetooth options in AVAudioSession. my final solution to handle all cases is here: https://github.com/xialin/AudioSessionManager – xialin Jan 28 '14 at 14:59
  • @xialinZZZ, I've found your code interesting and wonder if you could answer my question right there? http://stackoverflow.com/questions/21434245/how-to-let-my-app-audio-to-nicely-interrupt-iphone-audio-while-speaking – Stéphane de Luca Jan 29 '14 at 23:06

0 Answers0