Page 1 of 1

Distorted audio effect...

PostPosted: Mon Sep 04, 2017 7:10 pm
by Bootfit
I've just added an audio effect (.wav file) to my game. It plays fine when playing over a normal audio player, but when it plays through the game it comes out elongated and distorted. Is there some action I need to add to remove this effect?

Cheers

Re: Distorted audio effect...

PostPosted: Mon Sep 04, 2017 8:09 pm
by blackhornet
This is almost always because you are playing the sound every tick. Make sure the sound only plays once. IE: On start of layout.

Re: Distorted audio effect...

PostPosted: Mon Sep 04, 2017 9:16 pm
by Bootfit
Can you explain how I do that? I'm still learning the basics.

Thanks.

Re: Distorted audio effect...

PostPosted: Mon Sep 04, 2017 9:29 pm
by blackhornet
You need to do some of the tutorials, otherwise you won't get far, and get frustrated when things don't work.

https://www.scirra.com/tutorials/top

Re: Distorted audio effect...

PostPosted: Sun Sep 10, 2017 8:43 pm
by cjbruce
Bootfit wrote:Can you explain how I do that? I'm still learning the basics.

Thanks.


In Construct, the entire event sheet is called every tick (nominally 60 times each second). Most likely, you don't want to start playing a sound every tick.

Instead, you probably only want to play the sound once when a particular event has occurred. For this you will need to use a "trigger". Many conditions are automatically designated as triggers, such as "On Start Of Layout", but some conditions are not, such as "health <= 0". In the latter case, you can add an additional condition called "Trigger Once While True". This will cause the event to only be called once, instead of every tock.