Highlighted

play audio from library

Explorer ,
Sep 26, 2020

Copy link to clipboard

Copied

usinf animate HTML5 Canvas, i need the very basic sctript to play sound from library

thank you

Views

61

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

play audio from library

Explorer ,
Sep 26, 2020

Copy link to clipboard

Copied

usinf animate HTML5 Canvas, i need the very basic sctript to play sound from library

thank you

Views

62

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
Sep 26, 2020 0
Adobe Community Professional ,
Sep 26, 2020

Copy link to clipboard

Copied

Hi.

 

- Go to the Library and give a linkage name to your sound.

image.png

 

- Then use the static play method from SoundJS:

createjs.Sound.play("Voice0");

 

- If you want to stop the sound, you first store the AbstractSoundInstance that is returned by the play method in a variable or property and then use it as a reference later on. Like this:

this.voice0 = createjs.Sound.play("Voice0");
/*
.
.
.
*/
this.voice0.stop();

 

I have a sample of a narrated story in my GitHub repo that demonstrates how to use this method to play voices and a background music to tell a story if you're interested.

https://github.com/joao-cesar/adobe/tree/master/animate%20cc/html5_canvas/narrated_story

 

I hope this helps.

 

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

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...
Sep 26, 2020 0
udik LATEST
Explorer ,
Sep 26, 2020

Copy link to clipboard

Copied

thank you

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...
Sep 26, 2020 0