Sound Effects

For questions about using Classic.

Post » Mon Apr 26, 2010 6:35 am

I haven't actually used sound effects in my projects before so this will be a learning experience. I've searched the forums and looked through the wiki, but there seems to be rather limited material on how to implement sound effects properly. Here's my situation, or at least a similar situation that I can get what I need from. What is the proper event setup for:

>Is Button Held?
>>Play Sound

And, more importantly, stopping the sound as soon as the button is released.

Now, some questions:

Can I start the sound where it left off?
Can I force it to loop if it ends?
How do I prevent it from starting over and over again each tick?
Posts: 68
Reputation: 1,136

Post » Mon Apr 26, 2010 7:42 am

[quote:283tr7da]How do I prevent it from starting over and over again each tick?[/quote:283tr7da]

If Autoplay doesn't work try
[code:283tr7da]+ System: Trigger once
+ MouseKeyboard: Key Space is down
-> XAudio2: Autoplay file AppPath & "example.wav" (No loop)[/code:283tr7da]

You can play any sound easily with the Autoplay trigger with XAudio2 but if you want more extensive control you can set your sounds to different channels. It might be a bit of an overkill to set every sound to a different channel as I'm sure they are mixed together when played instead of muting each other while overlapping.

I prefer setting a channel for a whole category of sounds such as Player, Enemies, Environment and the like.

[quote:283tr7da]Can I start the sound where it left off?[/quote:283tr7da]
You can pause and unpause sounds.
[quote:283tr7da]Can I force it to loop if it ends?[/quote:283tr7da]
You can quit a loop on a channel.
Posts: 101
Reputation: 2,152

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest