fix: stopAll只suspend不resume,防止停止后声音立即恢复

This commit is contained in:
testadmin
2026-05-13 14:19:59 +08:00
parent e2f0346a81
commit 236fb5ec0e
+1 -2
View File
@@ -322,8 +322,7 @@ function stopAll() {
// Stop any Web Audio sources // Stop any Web Audio sources
const ctx = getAudioContext() const ctx = getAudioContext()
if (ctx && ctx.state === "running") { if (ctx && ctx.state === "running") {
// Suspending and resuming is the cleanest way to halt all sources ctx.suspend().catch(() => {})
ctx.suspend().then(() => ctx.resume()).catch(() => {})
} }
// Stop HTML pool elements // Stop HTML pool elements
for (const el of htmlPool) { for (const el of htmlPool) {