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

HTML5 Sound issues in 20.0.2

Explorer ,
Mar 04, 2020 Mar 04, 2020

Copy link to clipboard

Copied

I just updated to 20.0.2 and now none of my sounds work (HTML5 canvas doc).

 

Sounds added to the timeline don't make a sound

 

Sounds played via javascript get an error ("TypeError: Cannot read property 'startTime' of undefined")

TOPICS
Code , Error , Publish package

Views

2.1K

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

LEGEND , Mar 10, 2020 Mar 10, 2020

I think that some of those example commands are for people using CreateJS outside of Animate, and if CreateJS changed, maybe some of those examples don't work the same anymore.

 

For me, I double-click the Link column in Library, for the sound I'm using, type in "test", then this line works fine:

 

createjs.Sound.play("test");

 

To tie it to a movieclip named 'red', I have this:

 

this.red.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler(){
createjs.Sound
...

Votes

Translate

Translate
Explorer ,
Mar 06, 2020 Mar 06, 2020

Copy link to clipboard

Copied

update: went back to 19.2...(couldn't go back to 18 unfortunately).

 

Now sounds triggered by Javascript (createjs.Sound.play) work again (they don't throw an error).

 

But timeline sounds are not working. No error, but no sound.

 

Come on, there's no way we went all the way through v19 with this being the case, right? But for the life of me I can't imagine why sounds put on a frame in the timeline would work in v18 and not work in v19 and v20.

 

Anyone else had this? Or maybe I should ask: do your timeline sounds work in v19 or v20 ?

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
Explorer ,
Mar 06, 2020 Mar 06, 2020

Copy link to clipboard

Copied

Well I guess I'll let this issue go dormant if no one else has it. I tried re-importing the sounds, no luck. Nothing plays on the timeline. I didn't have anything starting on the first frame, which was a known issue at one time.

 

Again, javascript sounds (createjs.Sound.play) work in 19.2....v20 moved to a different version of createjs, and that's where the problem with javascript sounds probably lies. CreateJs is throwing an error for some reason, where it didn't before.

 

But since I moved back to 19.2, javascript sounds work again. So instead of timeline sounds, I include javascript on the same frame that just plays the sound using createjs.Sound.play. I of course had to give each sound a linkage name to do this.

 

Works just the same now as it did before: had to go back a version of Animate (and therefore createjs) and add javascript code to do what the frame's "sound" specification was supposed to do.

 

So for now, no using timeline sounds, and I'm sticking with 19.2 until 20.0.2 and createjs work their sound issues out.

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 ,
Mar 06, 2020 Mar 06, 2020

Copy link to clipboard

Copied

Make sure you have it on stream.

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
Explorer ,
Mar 09, 2020 Mar 09, 2020

Copy link to clipboard

Copied

Can't put it on stream in HTML5 Canvas, there is only option for "event" in HTML5 Canvas development.

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 ,
Mar 09, 2020 Mar 09, 2020

Copy link to clipboard

Copied

Previously you would have to do a user action on mobile to start sound working. It looks that's now the case with desktop browsers, at least some. On macOS Catalina, Safari and Chrome need you to do a mouse click, but Microsoft Edge and Firefox don't.

 

What was the Javascript you did, and the error that you saw?

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
Explorer ,
Mar 10, 2020 Mar 10, 2020

Copy link to clipboard

Copied

Right, sometimes sounds won't play before a user click. In all my cases, there is a user click.

 

The javascript command I'm using is

 

createjs.Sound.play("mySoundLinkageName", false, 0, 0, 0, 1);

 

and the error I get is

 

TypeError: Cannot read property 'startTime' of undefined

 

which is generated from the "compiled" javascript

 

var d=createjs.PlayPropsConfig.create(b),e=c.createInstance(a,d.startTime,d.duration),f=c._playInstance(e,d);

 

(i.e., I don't have a startTime var attached to anything, it comes from createJs or Animate)

 

The same javascript works fine in v18 and v19, no errors.

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 ,
Mar 10, 2020 Mar 10, 2020

Copy link to clipboard

Copied

I think that some of those example commands are for people using CreateJS outside of Animate, and if CreateJS changed, maybe some of those examples don't work the same anymore.

 

For me, I double-click the Link column in Library, for the sound I'm using, type in "test", then this line works fine:

 

createjs.Sound.play("test");

 

To tie it to a movieclip named 'red', I have this:

 

this.red.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler(){
createjs.Sound.play("test");
}
 
If I add the other parameters, then I get script errors.

 

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
Explorer ,
Mar 10, 2020 Mar 10, 2020

Copy link to clipboard

Copied

Ok, that works! I figured createjs had changed in some way to break that code, since it worked fine in v18 and v19 but not v20, which updated the createjs version used.

 

Not sure where I got that code with the parameters, but really, finding anything related to HTML5 Canvas and Animate is hard to come by.

 

Well that solves half my problem.

 

The other half is that keyframe sounds don't play in v19 or v20....I'll make a different post on that to separate the two issues.

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 ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

LATEST

Hello,

 

Could we change the volume with your solution?

 

Best regards

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