How to use create.js for seamless background music?

New Here ,
Aug 09, 2018 Aug 09, 2018

Copy link to clipboard

Copied

Hi, after browsing the web for hours, I managed to find a code that sort of works:

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

createjs.Sound.registerSound("https://s0.vocaroo.com/media/download_temp/Vocaroo_s03IOthwckn1.mp3", "bgmLoop");

function handleLoad(event) {

  var bgmLoopInstance = createjs.Sound.play("bgmLoop", {

  interrupt: createjs.Sound.INTERRUPT_ANY,

  loop: -1

  });

}

The problems are:

1. The music doesn't loop seamlessly, there's a gap before it starts back again.

2. The music doesn't start in desktop Firefox and Chrome.

Anyone have any ideas how to fix?

I heard howler.js does loops seamlessly, but I have no idea how to use it together with createjs in Animate CC.

TOPICS
Discussions

Views

746

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 , Aug 10, 2018 Aug 10, 2018
Try this tutorial. It is about looping and may help you fix your issue.JavaScript beginner tutorial 22 - for loop - YouTube

Likes

Translate

Translate
Aug 10, 2018 Aug 10, 2018

Copy link to clipboard

Copied

Hey there,

Gaps in looping html 5 audio is a common problem.

Not sure about create.js but I found a JavaScript solution for here: Hivenfour/SeamlessLoop · GitHub

My intelligence is quite limited so if you need help in incorporating this GitHub seamless loop into your file, we would need an expert to chime in over here.

Thanks,

Ankush

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 ,
Aug 10, 2018 Aug 10, 2018

Copy link to clipboard

Copied

LATEST

Try this tutorial. It is about looping and may help you fix your issue.

JavaScript beginner tutorial 22 - for loop - YouTube

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