[r124] Stopping Instances of the same sound

Bugs will be moved here once resolved.

Post » Tue Apr 09, 2013 8:51 pm

Link to .capx file (required!):
destroyInstanceSound.capx

Steps to reproduce:
You can drag&drop the red sprite to hear the effect of the 4 positionned sound
When you click on a blue sprite, it is destroyed and the sound they "emit" should stop.

Observed result:
Only if you destroy the instance with the highest IID will you stop all sounds.
Else the positionned sound are still playing their sound on position.

Expected result:
When I destroy a sprite, the associated positionned sound should be destroyed

I looked into the audio plugin.
The cause of this, is that when getAudioBuffer is called it will return the same AudioBuffer for the 4 sounds.
So in getAudioInstance, this AudioBuffer will see it's playTagWhenReady property overwritten by a new tag each time until the last enemy instance.
I couldn't quite find why the C2AudioInstances's tag does the same but they do (probably in request.onload in C2AudioBuffer's constructor).
Then, when the stop action is executed the 3 first tags won't be recognized.
So none of the positionned sound will stop.

Browsers affected:
Chrome: yes
Firefox: probably
Internet Explorer: probably

Operating system & service pack:
Windows server 2008 r2 SP1
Construct 2 version:
r124
Blood Type:
O+
Joke level:
-InfiniteYann2013-04-09 20:51:19
Last edited by Yann on Sun Sep 14, 2014 7:25 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Apr 13, 2013 1:47 pm

Thanks, should be fixed in next build.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests