lars Posted August 20, 2020 Share Posted August 20, 2020 Hey I´m having some problems to stop multiple howl objects: I¨m doing as the following when i starting multiple sounds: this.soundEventOtherObj = new Howl({ src: [this.asset.get("sound/" + pathObj[ii].sound)], autoplay: true, loop: false }); this.collectSounds[ii]=this.soundEventOtherObj; console.log(this.collectSounds); this.collectSounds[ii].play(); Its a part of a loop. I collect the howl objects in a array to be able to stop them later. Så to "restart the sounds" (part of drag and drop) i have to stop the howl objects, and do as the following; for (let iii = 0; iii < this.collectSounds.length; iii++) { this.collectSounds[iii].stop(); this.collectSounds = []; } If i use audioSprite, where im only use one howl object, everything works fine. But unfortunately I cannot in this project. Is there a way to call multiple sounds on one howl object? Quote Link to comment Share on other sites More sharing options...
mentuat Posted August 20, 2020 Share Posted August 20, 2020 (edited) You might need to store the 'sound ID' in addition to the howler object when you play a specific sound so you can stop it later eg. var soundID = sound.play() sound.stop(soundID) Edited August 20, 2020 by mentuat Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.