on-internet
← Community

Stop all sources from an array in Web Audio API

Stack Overflow ·

I am collecting all sound sources into an array so that I can stop them later. However, when I iterate through the array and call stop(), the sounds keep playing instead of stopping. Yet, if I call stop() on an individual source directly within the playSound() functions, they stop without any issues. I cannot figure out what the problem is. I am also aware that I could simply turn down the volume, but that doesn't seem like a proper solution to the problem. function audioContextCheck() { if(typeof AudioContext !== "undefined") { return new AudioContext(); } else if(typeof webkitAudioContext !=

Comments

Sign in or sign up to comment and upvote.

No comments yet.