prevent selection while playing to avoid artifacts
This commit is contained in:
parent
69554c0762
commit
b3522fea6a
5 changed files with 32 additions and 12 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue