Merge pull request 'Feat: Support External AudioContext Injection' (#1833) from 1d10t/strudel:main into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1833
This commit is contained in:
commit
526083d7c9
1 changed files with 3 additions and 1 deletions
|
|
@ -103,8 +103,10 @@ export async function renderPatternAudio(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function webaudioRepl(options = {}) {
|
export function webaudioRepl(options = {}) {
|
||||||
|
const audioContext = options.audioContext ?? getAudioContext();
|
||||||
|
setAudioContext(audioContext);
|
||||||
options = {
|
options = {
|
||||||
getTime: () => getAudioContext().currentTime,
|
getTime: () => audioContext.currentTime,
|
||||||
defaultOutput: webaudioOutput,
|
defaultOutput: webaudioOutput,
|
||||||
...options,
|
...options,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue