fix(assets): try to fix audio delay

This commit is contained in:
2026-03-11 00:10:25 +01:00
parent ed2bafb8bd
commit edd5322503

View File

@@ -41,7 +41,12 @@ const createAudio = (path: string) => {
const node = audioContext.createBufferSource();
node.buffer = buffer;
node.connect(gain).connect(audioContext.destination);
if (audioContext.state === "suspended") {
audioContext.resume().then(() => node.start());
} else {
node.start();
}
},
};
};