XAudio : bug on closing

For questions about using Classic.

Post » Fri Jun 12, 2009 12:33 pm

Hi,
I have a quite annoying problem with the XAudio2 object : if I close the application while a sound is playing (an ogg file), the sound sometimes keeps looping and the application crashes 3 secondes after.
What could I do to solve this problem?
B
8
S
4
G
5
Posts: 32
Reputation: 2,816

Post » Fri Jun 12, 2009 12:37 pm

Does this happen in the latest testing build, 0.99.3?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Jun 12, 2009 1:02 pm

For now I've only tested the 0.98.9 version. I'm downloding the 0.99.3 :wink:

EDIT : Looks like it works :D And I didn't have any bug with my current projects (I'm so afraid of "unstable" versions ;) )
All right then, thanks for fixing this bug :)

Re-edit : Damn. It just happened again. But it occurs less often than with the 0.98.9.
B
8
S
4
G
5
Posts: 32
Reputation: 2,816

Post » Fri Jun 12, 2009 6:59 pm

Does this happen with builds, or with previews? Or both?

Anyway, as a workaround, you could add a shutdown procedure to your game:

[code:ijmrk4ea]+On key "Esc" pressed
-Stop all sounds
-Call function "Close" after 100ms

+On function "Close"
-Close application[/code:ijmrk4ea]

or something like that. It might be overkill, but as a workaround it might do the trick for now.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Jun 16, 2009 7:04 pm

It happens with both builds and previews.
Your workaround is a good idea, but it won't work if the user decides to close the application by pressing Alt+F4, for instance. Is there any way to prevent the application from being closed using Alt+F4?
B
8
S
4
G
5
Posts: 32
Reputation: 2,816

Post » Tue Jun 16, 2009 7:32 pm

Hmm, not sure. I tried the "Cancel close" action using a variety of conditions (including keypresses and "End of Application") but it didn't seem to work. I'm not sure if I'm doing it wrong or what.

Anyway, you might try something like this:

[code:3mza8m3i]+End of application
>Stop all sounds[/code:3mza8m3i]

and see if that has any effect. Worth a shot, anyway.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Jun 16, 2009 9:17 pm

I tried the "Cancel close" too but like you, seems like I'm doing it wrong :(
The "End of Application > Stop all sounds" doesn't work, too bad. I really thought it was working after 6 tries, but the 7th one proved me wrong :P
B
8
S
4
G
5
Posts: 32
Reputation: 2,816


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests