Merge pull request #882 from daslyfe/audio_device_selection
bugfix: suspend and close exisiting audio context when changing interface
This commit is contained in:
commit
5150ec06dc
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