Skip to main content
December 7, 2013
Question

Sound resume issue

  • December 7, 2013
  • 1 reply
  • 598 views

Hi everyone!

I have some issue with resuming sound on iOS devices. If I block device while playing my app then unblock it in a short time everything is fine and all sounds in my app resume, but if I wait some minutes while device is blocked, then unblock it and  now the sounds doesn`t play, or start to play later after some time left.

To stop the app I use this:

private function deactivate(e:flash.events.Event):void

                    {

       flash.system.System.pause();

        Starling.current.stop();

                    }

private function activate(e:flash.events.Event):void

                    {

                                   flash.system.System.resume();

                                   Starling.current.start();

                    }

I also try this to hide only the sound:

private function deactivate(e:flash.events.Event):void

  {

     SoundMixer.soundTransform = new SoundTransform(0);

  }

  private function activate(e:flash.events.Event):void

  {

       SoundMixer.soundTransform = new SoundTransform(1);

  }

but it still don`t work (( Hope I could explain my problem! any ideas or advices?

Thanks in advice!

This topic has been closed for replies.

1 reply

Inspiring
December 10, 2013

Native Soundmanagement in Flash is not too reliable.

Use a soundframework like this:

https://github.com/treefortress/SoundAS

for more predictable behaviour

December 10, 2013

Thanks for your advice moccamaximum ! I`ll try soundframework surely )!

I have already solved this problem (thanks to good people in starling forum )

this property works for me pretty good:

SoundMixer.audioPlaybackMode = AudioPlaybackMode.AMBIENT;