Skip to main content
Frédéric C.
Inspiring
May 26, 2016
Answered

Background sound stuttering when going idle in IOS

  • May 26, 2016
  • 1 reply
  • 2002 views

Hi,

I'm facing a very annoying issue on iOS. I made some guided meditations apps, and I need to play the meditation is the background. Problem is that whenever the device goes into idle mode (either by waiting, or by pressing the power button), the sound stutters and is silenced for 1 or 2 seconds. Which is very annoying, especially when you are in the middle of a meditation and need to hear instructions clearly.

I have a bit more complex code in my apps, using SoundChannel and SoundLoaderContext objects, but even with the very simple code below, the problem happens:

package {

    import flash.display.Sprite;

    import flash.media.Sound;

    import flash.net.URLRequest;

   

    public class Main extends Sprite

    {

        public function Main()

        {

            var mySound:Sound = new Sound();

            mySound.load(new URLRequest("Local/Demo.mp3"));

            mySound.play();

        }

    }

}

In my application.xml file, I have:

<InfoAdditions><![CDATA[

     <key>UIBackgroundModes</key>

        <array>

            <string>audio</string>

        </array>

         ]]></InfoAdditions>

I tried many things, like using a big buffer in my SoundLoaderContext object, or using "NativeApplication.nativeApplication.executeInBackground = true", but nothing helps. It happens on several devices (iPhone 4S and iPhone 6). Happens with AIR 19 and latest AIR 22 beta.

The only occurrence when it doesn't happen is when I launch the audio, press the HOME button (so the app is sent to the background and I see the iOS dashboard), then press the power button. Here, no sound interruption. But if I press the power button while the app is in the foreground, the stuttering/hiccup/pause bug occurs.

If you simply want to hear what it sounds like, you can download this app: Beyond Affirmations - Guided Meditations on the App Store

Then launch the free audio session, and once it starts playing, press the Power button of the device. You'll hear the sound is silenced briefly for a second or 2, but it's enough to be very annoying.

Could you please help us with this, as this must be a general blocking issue for anyone making an audio player on iOS, and it is very unpleasant for the user.

Thank you very much!

Frédéric

PS: I read about this ANE: GitHub - freshplanet/ANE-Background-Music: Air Native Extension (iOS and Android) for managing background music and I don't know if it would solve the problem. Unfortunately, it is 4 years old, and I develop on PC, so I can't recompile it. Would someone have a more recent build please?

This topic has been closed for replies.
Correct answer Frédéric C.

OK I created an entry here: Bug#4184841 - Background sound stuttering when going idle in IOS

Please tell me if you need more information.


I just tested AIR 24 beta, and the issue is indeed fixed! Thank you so much to the Adobe AIR team, this is a life saver for audio apps developers. Cheers!

1 reply

Adobe Employee
May 26, 2016

Hi Frédéric,

We are looking into this issue and let you know soon as we have the fix.

-Roshan

Adobe AIR

Frédéric C.
Inspiring
June 14, 2016

Hi Roshan,

Any update on this very annoying issue, please? Did you at least manage to reproduce it on your side? Sorry for asking, but this is almost a showstopper for us, and for anybody willing to make an iOS app playing sound in the background. Thank you very much!

Frédéric C.
Inspiring
August 29, 2016

Hi,

Thanks for reporting the issue to us.

Could you please log a bug at bugbase.adobe.com ?

Thanks,

Adobe AIR Team


OK I created an entry here: Bug#4184841 - Background sound stuttering when going idle in IOS

Please tell me if you need more information.