fix: add AudioContext resume in main timer
This commit is contained in:
@@ -122,6 +122,9 @@
|
|||||||
function playBeep(frequency, duration, type = 'sine') {
|
function playBeep(frequency, duration, type = 'sine') {
|
||||||
try {
|
try {
|
||||||
const ctx = getAudioContext()
|
const ctx = getAudioContext()
|
||||||
|
if (ctx.state === 'suspended') {
|
||||||
|
ctx.resume()
|
||||||
|
}
|
||||||
const oscillator = ctx.createOscillator()
|
const oscillator = ctx.createOscillator()
|
||||||
const gainNode = ctx.createGain()
|
const gainNode = ctx.createGain()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user