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

How to play and stop multi audio in html canvas

New Here ,
Oct 20, 2020 Oct 20, 2020

Copy link to clipboard

Copied

Need an idea of ​​playing multiple sounds in html5 canvas.

Views

408

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 20, 2020 Oct 20, 2020

Hi.

 

Perhaps this example will help you.

https://github.com/joao-cesar/adobe/tree/master/animate%20cc/html5_canvas/narrated_story

 

Just call your sounds like this:

this.playSound("Voice0", "voice", false, { volume: 0.2, loop: -1 });

 

The first argument is the linkage name of your sound in the Library.

image.png

 

The second argument is a custom id you pass to create categories for your sounds. For example: "bgm", "sfx", "narration", and so on.

 

The third argument stops the previous playing sound in t

...

Votes

Translate

Translate
Community Expert ,
Oct 20, 2020 Oct 20, 2020

Copy link to clipboard

Copied

Hi.

 

Perhaps this example will help you.

https://github.com/joao-cesar/adobe/tree/master/animate%20cc/html5_canvas/narrated_story

 

Just call your sounds like this:

this.playSound("Voice0", "voice", false, { volume: 0.2, loop: -1 });

 

The first argument is the linkage name of your sound in the Library.

image.png

 

The second argument is a custom id you pass to create categories for your sounds. For example: "bgm", "sfx", "narration", and so on.

 

The third argument stops the previous playing sound in the same category.

 

The fourth argument are play props. You can see more about these props here:

https://createjs.com/docs/soundjs/classes/PlayPropsConfig.html

 

I hope these help.

 

Regards,

JC

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 ,
Oct 20, 2020 Oct 20, 2020

Copy link to clipboard

Copied

@JoãoCésar 

Thank you for the reply!

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 21, 2020 Oct 21, 2020

Copy link to clipboard

Copied

LATEST

You're welcome!

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