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

In a bit of an animate HTML5 pickle regarding sound fx and music

New Here ,
Jul 25, 2020 Jul 25, 2020

Copy link to clipboard

Copied

Hi all,

 

I seem to have got my self into a pickle where I used to create animations with sound using flash cs5 and now with flash  (.swf) files going I've recreated my animation with Animate and a HTML5 canvas but no sound!

 

Ive tried using the HTML5 audio component but I dont want to autoplay a sound like that I want it to happen more often with the action on screen.

 

What am I not getting lol

Views

154

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 ,
Jul 25, 2020 Jul 25, 2020

Copy link to clipboard

Copied

if you have a sound in your library with linkage id = soundID, you can use:

 

var sound = createjs.Sound.createInstance("soundID");

sound.play();

 

p.s.  you may need user interaction with page before sound will play.

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
New Here ,
Jul 25, 2020 Jul 25, 2020

Copy link to clipboard

Copied

Hi thanks for your quick reply. So if I get this right. I can use the
JavaScript to play different sounds as the play head travels across the
timeline?

My animation contains a surfer learning to surf with background music
playing thought out then on two occasions he says surfs up and better luck
next time. Can I trigger those without having to bind them to a button for the user to click. 

Thanks

 

Jonny

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
LEGEND ,
Jul 25, 2020 Jul 25, 2020

Copy link to clipboard

Copied

Playing sounds as the playhead travels across the timeline is literally what timeline audio is for. Why are you messing around with the audio component? That's for programmatic audio.

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
New Here ,
Jul 25, 2020 Jul 25, 2020

Copy link to clipboard

Copied

LATEST

Hi this is where I'm really confused with the html5 canvas. 

Any sounds I put into a key frame onto the timeline do not play when published out to the html5 webpage. The final output needs to be html5 compliant with the animation embedded into a webpage (it can't be a .SWF)

The copious amounts of googling I did led me to the audio component which doesn't work with multiple auto play sounds.  

What's my next step?

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