suspend and close exisiting audio context
This commit is contained in:
parent
63066937e9
commit
8f56ef6507
2 changed files with 7 additions and 5 deletions
|
|
@ -30,11 +30,12 @@ let audioContext;
|
|||
|
||||
export const setDefaultAudioContext = () => {
|
||||
audioContext = new AudioContext();
|
||||
return audioContext;
|
||||
};
|
||||
|
||||
export const getAudioContext = () => {
|
||||
if (!audioContext) {
|
||||
setDefaultAudioContext();
|
||||
return setDefaultAudioContext();
|
||||
}
|
||||
return audioContext;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue