Move things around to allow selection by name and avoid circular imports; fixed chebyshev
This commit is contained in:
parent
bb982e6b9b
commit
42ab65abdb
12 changed files with 142 additions and 106 deletions
18
packages/superdough/audioContext.mjs
Normal file
18
packages/superdough/audioContext.mjs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
let audioContext;
|
||||
|
||||
export const setDefaultAudioContext = () => {
|
||||
audioContext = new AudioContext();
|
||||
return audioContext;
|
||||
};
|
||||
|
||||
export const getAudioContext = () => {
|
||||
if (!audioContext) {
|
||||
return setDefaultAudioContext();
|
||||
}
|
||||
|
||||
return audioContext;
|
||||
};
|
||||
|
||||
export function getAudioContextCurrentTime() {
|
||||
return getAudioContext().currentTime;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue