You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the tab with the metronome app is made inactive the AudioContext is 'suspended' / 'interrupted' and has to be manually re-started with audioContext.resume(); in the play() function once the tab is made active again. (see https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/state)
This works on Chrome, but not in Safari. AudioContext is apparently re-started and running in Safari, but the audio clock is frozen leaving the application dead. The only workround I have found is to detect the 'suspended' or 'interrupted' state and then close the AudioContext and make a new one (plus any associated nodes like gain).
If the tab with the metronome app is made inactive the AudioContext is 'suspended' / 'interrupted' and has to be manually re-started with
audioContext.resume();
in theplay()
function once the tab is made active again. (see https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/state)This works on Chrome, but not in Safari. AudioContext is apparently re-started and running in Safari, but the audio clock is frozen leaving the application dead. The only workround I have found is to detect the 'suspended' or 'interrupted' state and then close the AudioContext and make a new one (plus any associated nodes like gain).
This then works in both Safari and Chrome. (see https://github.com/nmcgann/metronome for this fix and various other added features)
The text was updated successfully, but these errors were encountered: