Sound not playing first time (possible bug?)

Get help using Construct 2

Post » Wed Mar 05, 2014 6:45 pm

I'm creating a Breakout clone and it's going well.. except for one little annoying thing! When the ball hits a brick (which in this case is an alien) then BEEP_16 should play (and the alien is destroyed), and it does... for all but the first alien hit. The first alien hit, no matter which one, there is no sound, but the sound plays for all the other aliens when hit (the alien is destroyed though).

Below is the Event sheet, I'm preloading the sound and playing it 'on collision with Alien01'

Clipboard01.png

Can anyone point out why it won't play when the first alien is hit?

Thanks. :)
You do not have the required permissions to view the files attached to this post.
Last edited by Nickydude on Wed Mar 05, 2014 7:59 pm, edited 1 time in total.
B
72
S
25
G
9
Posts: 383
Reputation: 10,661

Post » Wed Mar 05, 2014 6:51 pm

Look into pre-loading sounds. Read about it in the manual in the audio section. It covers it pretty well. The sound gets loaded the first time it is called which means there will be a lag in the first play.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Wed Mar 05, 2014 7:08 pm

I'm already preloading the sound, it's there in the event sheet, if that's what you mean.

Preload loads a file without playing so that there is no lag when playing it for the first time.

from the manual:

You can also use the Preload action to start downloading an audio file without actually playing it. This can be done on Start of layout to start downloading a few important sound effects so there is no delay when they are played for the first time.


So wouldn't the sound be ready to play as it's been preloaded?
B
72
S
25
G
9
Posts: 383
Reputation: 10,661

Post » Wed Mar 05, 2014 7:42 pm

Well you got me stumped then :)
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Wed Mar 05, 2014 7:46 pm

Weird thing is that I can play the sound at the start of the layout so it's definitely there, it just doesn't play when the first alien is hit.
B
72
S
25
G
9
Posts: 383
Reputation: 10,661

Post » Wed Mar 05, 2014 7:58 pm

Right, I've narrowed it down to:

Play BEEP_16 not looping at volume 0db at object Alien01 (inner angle 360, outer angle...).....

This is a positional play and should play the sound at the position where the alien was hit, a left-hand side alien will play the sound over to the left when hit and a right-hand one will play it over to the right.

Putting a normal Play instead of Play at object works and will play when the first alien is hit. Is this a bug with Play at object or is it designed this way?

Anybody?
B
72
S
25
G
9
Posts: 383
Reputation: 10,661

Post » Wed Mar 05, 2014 11:33 pm

It depends, some sound features require the advanced audio API which is not supported on all browsers, directional audio I believe is one of those...
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Wed Mar 05, 2014 11:51 pm

I'm using the latest stable FireFox (27.0.1) and directional audio is working, just not for the first alien where there's no sound whatsoever.
B
72
S
25
G
9
Posts: 383
Reputation: 10,661

Post » Tue Jul 19, 2016 6:00 am

Nickydude wrote:I'm using the latest stable FireFox (27.0.1) and directional audio is working, just not for the first alien where there's no sound whatsoever.


Sorry to bump a post this old, but it seems there's still some problems with this. In my project the first time directional audio is played it always results in about 1 second freeze. Is there anything that can be done to prevent this?
Image
B
96
S
36
G
17
Posts: 351
Reputation: 15,903


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, marc254, tarek2 and 19 guests