• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Sound problem

Participant ,
Oct 07, 2018 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.

Views

2.6K

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

Community Expert , Oct 09, 2018 Oct 09, 2018

you can‘t.  read the chrome info.

Votes

Translate

Translate
Community Expert ,
Oct 07, 2018 Oct 07, 2018

Copy link to clipboard

Copied

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

Votes

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

Votes

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
Community Expert ,
Oct 08, 2018 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.

Votes

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
Participant ,
Oct 08, 2018 Oct 08, 2018

Copy link to clipboard

Copied

Can you show me this.

Votes

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
Community Expert ,
Oct 08, 2018 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");      

Votes

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
Participant ,
Oct 09, 2018 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.

Votes

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
Community Expert ,
Oct 09, 2018 Oct 09, 2018

Copy link to clipboard

Copied

you can‘t.  read the chrome info.

Votes

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
Community Beginner ,
Aug 06, 2020 Aug 06, 2020

Copy link to clipboard

Copied

how to know that the audio is over?

Votes

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
Community Expert ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

LATEST

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");  

Votes

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