Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

Externally Loaded Sound Plays Delayed

Open DarkAlchem opened this issue 2 years ago • 1 comments

Hope this is the correct place :)

I'm running AIR SDK v. 3.1.1.713 on an Android Device (testing on a Galaxy A32) and sounds that I've imported using flash.net.urlLoader always play delayed on the test device, but never on my Desktop emulation environment. I have my sound effects in a folder called 'sfx/' that sits in my root folder. I've included it in Animate's included files list and when I test it on my phone, the sound is always delayed.

`var sound=new Sound, SFX:SoundChannel = new SoundChannel, url='sfx/example.mp3';

    sound.load(new URLRequest( url ));
    sound.addEventListener(Event.COMPLETE, SFXLoad);

private function SFXLoad(ev:Event):void{
	ev.target.removeEventListener(Event.COMPLETE, SFXLoad);
	SFX = sound.play();
}

` Aside from this, I also attempted to preload all the sounds and store them in an object that I could access later and the delay was still there. So my preferred answer would solve the delay of sound playing on Android AND allow for externally loaded sounds.

##Potential Workaround Import the sound to the Library and Instantize it with a Class that can be used during Runtime.

DarkAlchem avatar Aug 30 '22 19:08 DarkAlchem

Look at #1841.

I think for now the best solution is have an ANE using SoundPool android class. In my tests the delay was around 100/150ms between SoundChannel and SoundPool .

caraiz avatar Sep 01 '22 21:09 caraiz