Fade out mp3

Explorer ,
May 03, 2020 May 03, 2020

Copy link to clipboard

Copied

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

TOPICS
How to

Views

742

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
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , May 08, 2020 May 08, 2020
assign a reference to your sound (when it's created) and start the fade when you want.

Likes

Translate

Translate
Adobe Community Professional ,
May 03, 2020 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
community guidelines
Explorer ,
May 04, 2020 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
community guidelines
Adobe Community Professional ,
May 04, 2020 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
community guidelines
Explorer ,
May 04, 2020 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
community guidelines
Adobe Community Professional ,
May 04, 2020 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
community guidelines
Explorer ,
May 07, 2020 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
community guidelines
Adobe Community Professional ,
May 08, 2020 May 08, 2020

Copy link to clipboard

Copied

LATEST

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
community guidelines