Skip to main content
June 12, 2013
Question

iOS speaker problem with ANE using microphone

  • June 12, 2013
  • 1 reply
  • 767 views

I am developping a language learning app which uses a native speech recognition engine linked with a Native Extension. Everything is working fine on the iPad, but on the iPhone speakers are behaving weirdly: the sound output goes to the phone speaker/receiver (the one used to make a call) so we can't hear anything.

I've tried several configurations:

When I play a sound in the app, and launch the ANE after, the sound output goes to the phone speaker, but the ANE has access to the microphone.

When I do the opposite, launching the ANE, then playing a sound, the sound output goes correctly in the loud speaker, but my ANE can't access the microphone.

I've tried setting useSpeakerphoneForVoice to true and using AudioPlaybackMode.MEDIA but it didn't change anything in both case.

Also, I tried to use the Microphone class, and when I initiate it and add a SampleDataEvent listener, everything is working better (sound in loud speaker and microphone working with the ANE) but on iPhones 4 and less sounds are garbled/scrambled and thus inaudible.

I'm using Air SDK 3.7 with iOS SDK 6.1.

Thank you for your help !

This topic has been closed for replies.

1 reply

Adobe Employee
June 17, 2013

Thanks for reporting the problem. Could you please share a sample application so that we can quickly test this out internally. If you'd like to keep this private, feel free to email the attachment to me directly(nimitja@adobedotcom).

Best Regards,

Nimit

June 24, 2013

Thank you for your answer. I was able to solve my problem with a small hack: In my ANE code, I used Objective-C's property kAudioSessionProperty_OverrideAudioRoute and set it to kAudioSessionProperty_OverrideCategoryDefaultToSpeaker so that it forces to use the main speaker for the output sounds.

I will still send you a sample app so that you can see what is happening.