prevent selection while playing to avoid artifacts

This commit is contained in:
Jade (Rose) Rowland 2023-12-30 22:40:27 -05:00
parent 69554c0762
commit b3522fea6a
5 changed files with 32 additions and 12 deletions

View file

@ -28,9 +28,13 @@ export const resetLoadedSounds = () => soundMap.set({});
let audioContext;
export const getAudioContext = (reset) => {
if (!audioContext || reset) {
audioContext = new AudioContext();
export const setDefaultAudioContext = () => {
audioContext = new AudioContext();
};
export const getAudioContext = () => {
if (!audioContext) {
setDefaultAudioContext();
}
return audioContext;
};