mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 22:35:15 -04:00
feat(superdough/audiocontext): make AudioContext injection optional
- Modify `setDefaultAudioContext()` to accept an optional `existingAudioCtx` parameter. - If provided, it will use the existing context; otherwise, it creates a new one. - This allows for better integration with external audio systems that manage their own AudioContext.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
let audioContext;
|
||||
|
||||
export const setDefaultAudioContext = () => {
|
||||
audioContext = new AudioContext();
|
||||
export const setDefaultAudioContext = (existingAudioCtx) => {
|
||||
audioContext = existingAudioCtx ?? new AudioContext();
|
||||
return audioContext;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user