Audio Sound Initial Playback Delay

Get help using Construct 2

Post » Sun Feb 28, 2016 3:45 am

it is my understanding that all SOUNDS in the SOUNDS folder should be automatically preloaded so that playback is instantaneous. However, every time I go to play a sound effect there is a brief lockup/delay in the whole project when the audio file is first begun. I even added an event that tells all other actions to wait until audio preloading is complete. The ONLY sound effect in the whole project now is no more than 10-11 seconds long.
What could be causing the audio (and the whole project) to delay/lockup upon initial playback?

Thanks!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
141
S
24
G
8
Posts: 790
Reputation: 15,119

Post » Sun Feb 28, 2016 8:03 am

Having sounds work well without a preload hasn't been my experience. I'd recommend at least trying that. Otherwise, capx?

EDIT: I think what you're thinking of is that sounds have to be downloaded completely before playing, whereas music can be streamed (the wording in the manual is a bit odd there and it seems to imply that sounds are ready to go, which they are not). This means that if a sound is not preloaded, it will be loaded the first time it plays, giving you the delay.
B
69
S
40
G
24
Posts: 355
Reputation: 18,312

Post » Mon Feb 29, 2016 5:45 am

@ultrafop - Yeah, it was my understanding that all sounds are preload at the start of layout...but that doesn't seem to be the case after all.
I go ahead and preload the sound file on a Start Of Layout event line, and then, on a new event line, I prevent the rest of the project from advancing until that sound has finished preloading. But, when I call on the sound file to play, it still has that split-second freeze-up. So that's what is confusing me.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
141
S
24
G
8
Posts: 790
Reputation: 15,119

Post » Mon Feb 29, 2016 7:24 am

Sounds like a weird quirk :/. So this is still happening even after setting the sound to preload (I'm guessing the added code about advancing the loading after the audio has loaded was tried after setting the preload)? I'm at a loss for what may be going on. My only other thought would be to wonder whether there's an added effect on the sound. I know that if I set certain effects incorrectly it can cause an entire project to run oddly.
B
69
S
40
G
24
Posts: 355
Reputation: 18,312

Post » Mon Feb 29, 2016 8:15 am

Here's my .CAPX.
I'm just as confused. On occasion, it works just fine. No delay.

@Ashley, may I inquire what it is that I'm missing in this case, please?
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
141
S
24
G
8
Posts: 790
Reputation: 15,119

Post » Mon Feb 29, 2016 6:10 pm

There shouldn't be any delay, but it will depend heavily on which browser and OS you use. Which OS/browser combinations have you tested and which are affected?

The .capx isn't much use unless it follows bug report guideline-style requirements. I've seen threads in the past where people say some audio playback was causing a performance problem, but it turned out to be a bunch of events that ran in response to audio playback starting.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Mon Feb 29, 2016 7:11 pm

@Ashley - Thank you for the info. ...so much still to learn.
I must admit I only use Chrome (I know better, but I don't usually test on Explorer or FireFox).

I'll search so more for audio playback issues to see if I can find anything worthwhile.

May I ask what events you speak of that caused issues in the past? Maybe that's what I'm doing and don't realize it... Though, I would be surprised if that's the case since I don't think I'm doing anything extraordinary...but then, I'm not adept at audio, either.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
141
S
24
G
8
Posts: 790
Reputation: 15,119

Post » Thu Mar 03, 2016 3:15 pm

@Rhindon It might be a Chrome for Android issue. I encountered a similar issue where the audio plugin was getting "stuck" on decoding my audio files. After searching, I found that Ashley had reported the issue to Google/Chromium project more than a year ago and it's only recently been marked as fixed.

I can't include links yet, but you can hunt down the report on the Chromium tracker. It's issue 424174.
B
6
S
2
Posts: 12
Reputation: 426


Return to How do I....?

Who is online

Users browsing this forum: 8tomo8, brunopalermo and 10 guests