00:00
00:00
Newgrounds Background Image Theme

Inkolypso just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Foss: dynamic echo/reverb sound fx

1,559 Views | 4 Replies
New Topic Respond to this Topic

FINAL ECHO SOUND FX CODE
------------------------------------------
-

Hear it:
http://img318.images..image=audioas0sr.swf

What you must know before using this script:
- calling functions
- importing sounds into the library
- applying a linkage to sounds

How to use
This script contains comments helping you to tweak the effect to your needs. It works with virtually any sound. But to give a good advice, the effect will sound more realistic with a sound that has a sharp end (i.e. no fade out or silence).

The code
// IMPORTANT
// This code must be on a frame in order to make the code effective

_root.vol1 = 100;
_root.sound1 = new Sound();

// Replace "son1" with your linked sound ID (right-click on your sound in the library, choose "Linkage", then check "Export for ActionScript" and put a linkage name in the corresponding box)

_root.sound1.attachSound("son1");

_root.onEnterFrame=function(){

// Specify the type of activation event below (this example calls the function when you press the "Enter" button. But you can call the fonction "echo()" from any other method. If you use another method, please remove the 3 lines below

if (Key.isDown(Key.ENTER)) {
echo();
}
function echo() {
_root.sound1.stop();
_root.vol1 = 100;
_root.sound1.setVolume(100);
_root.sound1.start();
_root.sound1.onSoundComplete = function() {
_root.sound1.setVolume(_root.vol1);

// Replace NUMERICVALUE below to change the length of echoed sound from the end of your sound (in seconds, must be smaller than the total length of your sound)

_root.sound1.start(NUMERICVALUE);

// Replace NUMERICVALUE2 below to change the length of the fade out (smaller value means longer fade out)
_root.vol1 -= NUMERICVALUE2;
if (_root.vol1<0) {
_root.sound1.stop();
_root.sound1.setVolume(100);
_root.vol1 = 100;
}
}
}
}

Need help ?
Contact me via MSN, email or AIM (see in my profile).

~gorman2001


website :: hugostonge.com

my job :: we+are

Response to Foss: dynamic echo/reverb sound fx 2005-07-27 10:11:53


kewl, maby make it fade out better and have them overlap a bit?

Response to Foss: dynamic echo/reverb sound fx 2005-07-27 10:14:51


<lie>
Very nice effect.
</lie>

I don't have speakers :D


BBS Signature

Response to Foss: dynamic echo/reverb sound fx 2005-07-27 10:16:48


At 7/27/05 10:14 AM, -Toast- wrote: <lie>
Very nice effect.
</lie>

I don't have speakers :D

gosh, that's bad :p


website :: hugostonge.com

my job :: we+are

Response to Foss: dynamic echo/reverb sound fx 2005-10-28 20:50:10


bump this old topic bitch !

lol

website :: hugostonge.com

my job :: we+are