Flash Delay / ActionScript 3 Sound Delay

Im working on a flash project where I load some sounds from external files. The problem is that when I play them as part of my project, there is a slight delay from the moment when they should be played until they start playing.

My sounds are very short and load before the project actually uses them. I was looking for a problem on the Internet, and it seems that the problem is not what is happening just for me. But, not from the resources that I found, there were some clear ways to eliminate them.

Some resources say you can fix this when I constantly play in the background. I have it, but it does not help. I also looked at the actual sound file in the sound instrument, and there is a slight delay before the sound starts, but it is very small and should not lead to the delay observed in my flash project.

Does anyone know how to fix this?

+3
source share
4 answers

, , , 500 , , 300. wav, swf , , , . , CS4- . , SWF , , , ...

+1

? , , ? , , . , :

? AS3, , . , "mySound". , :

mySound.addEventListener(Event.COMPLETE,eventHandler);

:

function eventHandler(e:Event)
{
    play();
}

, .

0

I think you suffer from silence, which is added to the beginning of the sound using the MP3 codec. It adds everything that makes compression best for each file and can vary greatly. You need to open your MP3 files in an editor and measure the offset to the actual start of the sound, and then provide this value for the play () method as startTime.

0
source

Source: https://habr.com/ru/post/1722919/


All Articles