Fading out Audio


(Matt) #1

I have elements that on Mouse Down a tone is played and on Mouse Up the tone stops. Is there some way to have the tone fade out quickly on Mouse Up so that the sound of “clicking” is not audible?

Thank you!


(Greg) #2

Hi Matt, where is the “clicking” sound coming from? I don’t seem to hear a click on my tests. There is an old thread about fading sounds on the old forum that might help…

http://hype.desk.com/customer/portal/questions/8330066-can-i-make-an-audio-clip-fade-out-


#3

The link above should help you. Basically, in javascript, think of decreasing the volume over a period of time using setInterval() and the .volume property.

D


(Adam Gojanovich) #4

The above link doesn’t appear to work anymore. Did you ever come up with a solution @matt5834? I’m trying to make a piano keyboard and I’m hoping to get that effect. Thanks!


#5

@AdamG

What about @DBear’s suggestion does not work for You?


#6

Here’s how that code would look:


(Adam Gojanovich) #7

Thanks, I’ll give that a shot!