Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我同时使用网络音频 api 加载并播放了多个声音。有什么办法可以停止所有声音?
例如:现在停止所有声音的按钮。
由于我同时播放了 10 多个声音,我不想为每个声源手动使用 noteOff(0) (或 stop(0) )。
然后,实现所需效果的最简单方法是将它们全部连接()到一个增益节点,然后连接到目标,并设置 gain.gain.value = 0。
当然,它实际上不会阻止他们,但会让他们沉默。