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

Lire de sons à la suite avec playSound

Explorer ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

Bonjour à tous !

 

comment peux-ton lire 2 sons à la suite avec le code

playSound("FirstSound");
playSound("SecondSound");

 

Merci pour votre aide ..

 

TOPICS
ActionScript , Code

Views

1.6K

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 ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

is this an as3 or canvas/html5 project?

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 ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

canvas project ! sorry

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 ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

create a button (or something) that will start your sound playing:

 

// this.b is a movieclip

createjs.Sound.on("fileload", loadF.bind(this));
createjs.Sound.registerSound("./z_sounds/RS.mp3", "s1_id", 4);  // assign paths to your sounds
createjs.Sound.registerSound("./z_sounds/Buzzer.mp3", "s2_id", 4);
this.b.alpha = .3;

 

function loadF(){
this.b.alpha = 1;
this.b.addEventListener("click",f.bind(this));
}
function f(){
createjs.Sound.play("s2_id");
createjs.Sound.play("s1_id");
}

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 ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

Merci pour votre réponse !!! je ne suis pas programmeuse mais je vais essayer de me débrouiller avec ce code ... je reviens si je n'avance pas ... MERCI !!

 

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 ,
Nov 14, 2022 Nov 14, 2022

Copy link to clipboard

Copied

you're welcome.  and let us know whether all's well, or not.

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

Bonjour, je reviens vers vous ... puis-je vous envoyer mon projet car je ne comprends pas pourquoi mes 2 premiers sons ne fontionnent pas ... ils ne se lisent pas...

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

upload your fla to a file server and pist a link.

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

Merci Kglad, je vous ai fait un MP.

 

 

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

i got your file.

 

which buttons do you press that cause a sound failure?

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

il n'a pas de bouton ... c'est juste au démarrage du html

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

you can't have a sound playing without user interaction (eg, mouse click) in a html project.  ie, your html can't just open in a browser and start playing a sound. all modern browers block that (thank goodness).

 

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

Pourtant mes premiers HTML le son se jouait direct ... cela changé avec les versions ?

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

si on les mets direct sur la timeline ils les lisent normalement ...

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

nothing changes with differnt versions of animate.  only  different browser versions.

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

no, timeline sound or not, the user must interact with your html to before sounds can 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
Explorer ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

Bonjour, je ne comprends plus rien ! j'ai toujours fais comme ça... et ça focntionné .. la preuve !Capture d’écran 2022-12-02 à 08.59.06.png

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 ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

est-ce qu'on peut appeler le son de la bibliothèque sur la timeline sans mettre de bouton ?

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 ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

if that's a canvas/html5 project, how do you get to the frame with the sound?

 

answer: by clicking a button.  ie the user has to interact with your publication to start the sound.

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 ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

je me suis mal exprimé ce html est déjà intéractif puisqu'il est chargé sur une plateforme elearning. donc les sons de la timeline se lisent direct. donc pour moi c'est bon ... par contre j'aimerai connaitre le code pour lire 2 sons à la suite car mes sons se lisent ensemble et pas l'un apres l'autre ...

playSound("FirstSound");
playSound("SecondSound");

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 ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

to  play two sounds simultaneously, you can use the timeline (add each to the same frame in different layers) or code.  (note: because there may be different amounts of  presound dead space in the sounds, you may need to offset the frames.)

 

to use code, if the sounds are in your library, assign linkage ids (in the library panel), eg soundID1 and soundID2 and use:

 

var sound1 = createjs.Sound.createInstance("soundID1");
sound1.play();

var sound2 = createjs.Sound.createInstance("soundID2");
sound2.play();

 

 

if you want to load and play sounds, eg som1.mp3 and som2.mp3

 

createjs.Sound.registerSound("som1.mp3", "soundID1");  // use a path to som1 if not in current html directory.

var sound1 = createjs.Sound.play("soundID1");

 

createjs.Sound.registerSound("som2.mp3", "soundID2");

var sound2 = createjs.Sound.play("soundID2");

 

 

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 ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

j'essaye ceci dès lundi !!! merci je reviens vers vous si ça bugue .... 😄

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 ,
Dec 02, 2022 Dec 02, 2022

Copy link to clipboard

Copied

you're welcome. (and enjoy your weekend.)

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 ,
Dec 06, 2022 Dec 06, 2022

Copy link to clipboard

Copied

 

Bonjour Kglad, je n'y comprends rien ... en fait les 2 sons qui sont dans les boutons se lisent ensembles. je ne sais pas ou placé votre code et comment. Hé oui désolée je ne suis pas du tout expoerte en code..

Pouvez-vous m'indiquer ou les placer si je vous donne mon nouveau fichier ?

Merci de votre aide.

Laure

 

https://we.tl/t-6m3OoNqBFy 

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 ,
Dec 06, 2022 Dec 06, 2022

Copy link to clipboard

Copied

there are no sounds related to your buttons.

 

but you should prevent the narrations from overlapping.

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