Is it possible to direct audio output to a Bluetooth speaker in iOS 7 without using the MPVolumeView
UI class? (iOS 7 is required for my project.)
I need to do this because I am working on a native extension which will allow an Adobe Air application to send audio over A2DP. As I understand it native extensions preclude the use of UI classes so I cannot use MPVolumeView
.
There is an overrideOutputAudioPort:error:
method on AVAudioSession
but the only available overrides are AVAudioSessionPortOverrideNone
and AVAudioSessionPortOverrideSpeaker
(for the built-in speaker and microphone).
The documentation states that the setOutputDataSource:error
method needs to use an object from the outputDataSources
array which is only supported on “certain USB accessories”.
I understand that Apple prefers applications to allow the user free choice of audio output device but if I cannot use MPVolumeView
how can I offer this? I’d be happy to code the UI in ActionScript if I could just read and set the available options in the Objective-C extension but it seems to be impossible at present.
Have I missed anything or are there any other options I could use? Any thoughts or comments appreciated.
Edit: I was wrong to say that "native extensions preclude the use of UI classes". I am now displaying the MPVolumeView in my AIR application. However I would still like to know if it is possible to take more direct control of the audio output route.