Highlighted

Fade out mp3

Explorer ,
May 03, 2020

Copy link to clipboard

Copied

HTML5 canvas how do I do that so I fade out with single mp3 sound.createjs

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

assign a reference to your sound (when it's created) and start the fade when you want.

TOPICS
How to

Views

677

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Fade out mp3

Explorer ,
May 03, 2020

Copy link to clipboard

Copied

HTML5 canvas how do I do that so I fade out with single mp3 sound.createjs

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

assign a reference to your sound (when it's created) and start the fade when you want.

TOPICS
How to

Views

678

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 03, 2020 0
Adobe Community Professional ,
May 03, 2020

Copy link to clipboard

Copied

start a loop (eg, tick) and adjust the sound's volume in the listener function.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 03, 2020 0
Explorer ,
May 04, 2020

Copy link to clipboard

Copied

Can you show me an example with code how I do it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 04, 2020 0
Adobe Community Professional ,
May 04, 2020

Copy link to clipboard

Copied

this.s.addEventListener("click",f.bind(this));
this.fadeOut = fadeOutF.bind(this);


function f(){
	this.sound = createjs.Sound.play("soundID");
	this.addEventListener("tick", this.fadeOut);
}

function fadeOutF(){
	this.sound.volume -= .02;
	if(this.sound.volume <= 0){
		this.removeEventListener("tick", this.fadeOut);
	}
}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 04, 2020 1
Explorer ,
May 04, 2020

Copy link to clipboard

Copied

Thank you for helping me show code examples. Now I can add it to my slideshow.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 04, 2020 0
Adobe Community Professional ,
May 04, 2020

Copy link to clipboard

Copied

you're welcome.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 04, 2020 0
Explorer ,
May 07, 2020

Copy link to clipboard

Copied

I have this at the beginning of the frame of the slideshow:

 

createjs.Sound.on("fileload", handleFileLoad1);
createjs.Sound.registerSound("music1.mp3", "MySound1");

function handleFileLoad1()
{
createjs.Sound.play("MySound1");
}

but now several frames ahead I want to fade out the sound because I don't want a button. How do I do that?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 07, 2020 0
Adobe Community Professional ,
May 08, 2020

Copy link to clipboard

Copied

assign a reference to your sound (when it's created) and start the fade when you want.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 08, 2020 1