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

In the HTML5 canvas project, some sounds are not played.

New Here ,
Oct 08, 2021 Oct 08, 2021

Copy link to clipboard

Copied

I made a demo animation with voice (HTML5 Canvas). I cut each sentence into a sound file, and there were 30 sound files in total. They are placed in sequence on the timeline. Background music plays at the same time, so demo animations can only play a maximum of two sounds at one time. After the release, about 3 sounds did not play, These unplayed sounds were random, and each time a different sound did not play.

Views

1.3K
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 27, 2021 Oct 27, 2021

1. edit the sound in audition to remove sound before the start and after the finish of the desired sound.

2. yes, you can use the soundjs api, SoundJS v1.0.0 API Documentation : SoundJS (createjs.com) which includes play() and stop() methods

Votes

Translate
New Here ,
Oct 08, 2021 Oct 08, 2021

Copy link to clipboard

Copied

In addition, 30 sounds are placed in the voice layer and background music is placed in the BGM layer.

Votes

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, 2021 Oct 09, 2021

Copy link to clipboard

Copied

do all the sounds have their sync property set to stream?

Votes

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 10, 2021 Oct 10, 2021

Copy link to clipboard

Copied

Yes. Synchronizing sound and animation.

Votes

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 11, 2021 Oct 11, 2021

Copy link to clipboard

Copied

try removing the background sound.

Votes

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 12, 2021 Oct 12, 2021

Copy link to clipboard

Copied

Thank you for your method. It's OK after removing the background sound, but what should I do if I need the background sound?

Votes

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 12, 2021 Oct 12, 2021

Copy link to clipboard

Copied

try different sync properties for the background sound.  it will probably work as an event sound, but i would experiement.

Votes

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 13, 2021 Oct 13, 2021

Copy link to clipboard

Copied

After setting the synchronization property of the background sound to "event", the sounds in the voice layer play normally , but encountered more sound related problems, is there an easier way?

If there is no easier way, do you have a link to a web page about the solution?

Sound problems:

1. The background music doesn't play automatically.

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

3. The background music overlaps.

Votes

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 13, 2021 Oct 13, 2021

Copy link to clipboard

Copied

open your background sound in audition and remove white space.

reimport into your fla library and assign a linkage id (eg, soundID).

remove your background sound from the timeline and use:

 

var sound1 = createjs.Sound.createInstance("soundID");
sound1.addEventListener("complete",completeF);
sound1.play();

function completeF(){
sound1.play();
}

 

p.s. users will need to interact with your html to start sounds.

Votes

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 14, 2021 Oct 14, 2021

Copy link to clipboard

Copied

Sorry, I am not familiar with the script, I do not know how to use the script you provided, I put it in the first frame did not take effect.

After I used the script below, the background music can play, but the background music does not loop. In addition, the stop and pause scripts are not in effect.

Would you help me modify this script? The background music can be played in a loop and can be paused by pressing the button.

 

var root = this;

root.pauseSound = function()
{
if (root.bgm)
root.bgm.paused = true;
};

root.playSound = function(linkage)
{
if (root.bgm)
{
if (root.bgm.paused)
root.bgm.paused = false;
else
root.sendEvent("stopallsounds");
}
else
{
root.sendEvent("stopallsounds");
root.bgm = createjs.Sound.play(linkage);
}
};

root.stopSound = function()
{
if (root.bgm)
{
root.bgm.stop();
root.bgm = null;
}
};

root.sendEvent = function(name)
{
var event = new CustomEvent(name);
window.parent.document.dispatchEvent(event);
};

root.pause_btn.on("click", function(){ root.sendEvent("pauseallsounds") });
root.play_btn.on("click", function(){ root.playSound("BGM") });
root.stop_btn.on("click", function(){ root.sendEvent("stopallsounds") });

Votes

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 14, 2021 Oct 14, 2021

Copy link to clipboard

Copied

did you click your stage or something on stage when testing my code?

Votes

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 15, 2021 Oct 15, 2021

Copy link to clipboard

Copied

When I click the Play animation button the background music does not play, the background music starts to play when the animation plays to the voice, so I put a voice file (stream) in the second frame. But there are still two problems that you would like to help me solve?

1. When the background music ends, there is a brief noise before it starts again.

2. The background music is still playing after clicking the pause animation button.

Votes

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 15, 2021 Oct 15, 2021

Copy link to clipboard

Copied

does your background music have linkage id = soundID?

Votes

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 18, 2021 Oct 18, 2021

Copy link to clipboard

Copied

Yes, the background music have linkage id = soundID.

Votes

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 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

does the sound work here:  t (kglad.com)

Votes

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 25, 2021 Oct 25, 2021

Copy link to clipboard

Copied

Yes, after I clicked the black button the music played on a loop.

Would you like to send me the file for this example?

I'm sorry that I didn't reply you in time because I received an urgent task recently.

Votes

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 25, 2021 Oct 25, 2021

Copy link to clipboard

Copied

the fla contains nothing other than the sound with the linkage id and the black button with the code show in my oct 13 message, kglad.com

Votes

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 27, 2021 Oct 27, 2021

Copy link to clipboard

Copied

Thank you very much. After I use your script again, the background music can play normally. But there are the following questions. Would you like to help me again?

1. In the background music loop, noise appears at the moment before the next playback.

2. Is there a way to make the background music play or pause following the play and pause buttons of the animation?

Votes

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 27, 2021 Oct 27, 2021

Copy link to clipboard

Copied

1. edit the sound in audition to remove sound before the start and after the finish of the desired sound.

2. yes, you can use the soundjs api, SoundJS v1.0.0 API Documentation : SoundJS (createjs.com) which includes play() and stop() methods

Votes

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 ,
Nov 09, 2021 Nov 09, 2021

Copy link to clipboard

Copied

Thank you for helping me so much!

Votes

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 ,
Nov 09, 2021 Nov 09, 2021

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

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