Highlighted

Sound problem

Explorer ,
Oct 07, 2018

Copy link to clipboard

Copied

I have made an animation of an image in html5 canvas in animate cc. Then I add an mp3 song in a frame with this code:

createjs.Sound.on("fileload", handleLoad); 

createjs.Sound.registerSound("xxx.mp3", "bgmLoop"); 

function handleLoad(event) { 

  createjs.Sound.play("bgmLoop");

}

In microsoft edge, the sound works but the image is still white no image view.

When I remove the code in .fla for canvas, the image of the animation in canvas appears.

How to use create.js for seamless background music?  This person has the same problem as me with the code.

For me, I don't work both in Chrome or Android.

What is the problem in the HTML 5 animate CC program.

Can anyone solve it so that it works with background music in my animation.

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

you can‘t.  read the chrome info.

Views

1.1K

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

Sound problem

Explorer ,
Oct 07, 2018

Copy link to clipboard

Copied

I have made an animation of an image in html5 canvas in animate cc. Then I add an mp3 song in a frame with this code:

createjs.Sound.on("fileload", handleLoad); 

createjs.Sound.registerSound("xxx.mp3", "bgmLoop"); 

function handleLoad(event) { 

  createjs.Sound.play("bgmLoop");

}

In microsoft edge, the sound works but the image is still white no image view.

When I remove the code in .fla for canvas, the image of the animation in canvas appears.

How to use create.js for seamless background music?  This person has the same problem as me with the code.

For me, I don't work both in Chrome or Android.

What is the problem in the HTML 5 animate CC program.

Can anyone solve it so that it works with background music in my animation.

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

you can‘t.  read the chrome info.

Views

1.1K

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
Oct 07, 2018 0
Adobe Community Professional ,
Oct 07, 2018

Copy link to clipboard

Copied

there's nothing wrong with your code but open your console to see the problem.

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...
Oct 07, 2018 0
Explorer ,
Oct 08, 2018

Copy link to clipboard

Copied

// create global alias to main timeline for event handler  

// wait for sound to preload   

// assign load event handler 

createjs.Sound.on("fileload", handleLoad); 

// load and register sound 

createjs.Sound.registerSound("sacred.mp3", "soundID"); 

// play sound and start timeline playing 

function handleLoad(event) { 

createjs.Sound.play("soundID");  

I use this code in frame 1 in file musikprov.fla html5 canvas and in Microsoft Edge browser so works it but in Android os in smartphone and Chrome so don't works it.

I have read this WebAudio Plugin and CreateJS broken in new Chrome Update and there it stands "the policy will be re-applied to the Web Audio API in Chrome 70 (October)". Is it the browser error both in Android and Iphone Apple IOS with code.createjs.com Sound.

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...
Oct 08, 2018 0
Adobe Community Professional ,
Oct 08, 2018

Copy link to clipboard

Copied

you need to use a click event or some other user interaction for chrome to trigger the play() method.

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...
Oct 08, 2018 0
Explorer ,
Oct 08, 2018

Copy link to clipboard

Copied

Can you show me this.

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...
Oct 08, 2018 0
Adobe Community Professional ,
Oct 08, 2018

Copy link to clipboard

Copied

this.your_button.addEventListener('click',playF.bind(this));

function playF(){
createjs.Sound.play("soundID");
}
// load and register sound  
createjs.Sound.registerSound("sacred.mp3", "soundID");      

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...
Oct 08, 2018 0
Explorer ,
Oct 09, 2018

Copy link to clipboard

Copied

Yes this works in my Chrome browser. But I want to use sound then I come into the frame in begin without button or can I not to 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...
Oct 09, 2018 0
Adobe Community Professional ,
Oct 09, 2018

Copy link to clipboard

Copied

you can‘t.  read the chrome info.

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...
Oct 09, 2018 0
Community Beginner ,
Aug 06, 2020

Copy link to clipboard

Copied

how to know that the audio is over?

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...
Aug 06, 2020 0
kglad LATEST
Adobe Community Professional ,
Aug 10, 2020

Copy link to clipboard

Copied

use a "complete" listener.

 

this.your_button.addEventListener('click',playF.bind(this));

function playF(){
var sound_instance = createjs.Sound.play("soundID");
sound_instance.addEventListener("complete",completeF.bind(this));
}
function completeF(){
// sound completed play
}
// load and register sound  
createjs.Sound.registerSound("sacred.mp3", "soundID");  

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...
Aug 10, 2020 0