Skip to main content
Douglas McCarroll
Inspiring
June 14, 2017
Question

Audio stops working after receiving call on iOS

  • June 14, 2017
  • 1 reply
  • 1840 views

Hi All,

In my Apache Flex app (Flex 4.16, AIR 25) running on iOS, all audio stops working if/when the user receives a phone call, or even if the phone just rings once.

If the user then leaves the app, i.e. presses the phone's home key, then returns, the problem goes away.

I'm guessing that I have to do something in response to the app's DEACTIVATE or ACTIVATE events, like this:

NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, onActivateApp);

NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, onDeactivateApp);

   private function onActivateApp(event:Event):void {

      // do something here

   }

   private function onDeactivateApp(event:Event):void {

      // and/or here

   }

... and I've tried calling SoundMixer.stopAll() when the app deactivates, but that doesn't help...

Thoughts?

Thanks,

Douglas

This topic has been closed for replies.

1 reply

Douglas McCarroll
Inspiring
July 5, 2017

Hi,

I'm still stuck on this.

A bit of additional info. This is happening any time my app is 'interrupted', to use Apple's terminology. An interruption can consist of a phone call, an iPhone Clock app alarm going off, etc.

Once an interruption happens all sound stops working in my app until the user presses the iPhone Home button then returns to the app, at which point audio works again.

I'm not a native iOS programmer, but my googling suggests that in the native iOS world apps listen for an AVAudioSessionInterruptionNotification to find out when these interruptions occur. I'm not sure how useful this info is for understanding my current problem ... just saying ...

Is anyone else running into this?

Douglas

Douglas McCarroll
Inspiring
July 5, 2017

Update:

I've just created a minimal sample app that reproduces this problem.

I've created a bug report here: https://tracker.adobe.com/#/view/AIR-4198386

I've attached the sample app to the bug report.

Adobe - This is a fairly big problem...

Douglas McCarroll
Inspiring
July 19, 2017

Update: Comment in Tracker issue from Adobe - "Thanks for reporting this issue, Issue is reproducible at our end and we are investigating it".

If you're experiencing this problem, please vote for this issue.

Also, it looks as though this problem can also be triggered by playing a video. See this thread...

AIR 26 iOS 10.3.x/iOS 10.2.x Audio fail to work after playing the video