Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

Commit 482b2b4

Browse files
authored
Update audengine.js
1 parent 72e1bb0 commit 482b2b4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

audengine.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
// Ensure the AudioContext stays alive.
55
setInterval(() => {
66
if (audioCTX.state !== "running") {
7+
if (audioCTX) {
8+
audioCTX.close().catch(() => {});
9+
}
710
audioCTX = new AudioContext();
811
}
9-
}, 100);
12+
}, 100); //to avoid too many creation warnings in console, only do a rate of 0.1 seconds.
1013

1114
function cloneAudioBuffer(fromAudioBuffer) {
1215
const audioBuffer = new AudioBuffer({

0 commit comments

Comments
 (0)