From e4099946cddef24f16c1d8ba3515dc2ec995a428 Mon Sep 17 00:00:00 2001 From: prezmop Date: Sat, 26 Apr 2025 18:05:16 +0900 Subject: [PATCH] use prepare in web --- website/src/repl/useReplContext.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/src/repl/useReplContext.jsx b/website/src/repl/useReplContext.jsx index f0895aaa4..9348fa8c1 100644 --- a/website/src/repl/useReplContext.jsx +++ b/website/src/repl/useReplContext.jsx @@ -10,6 +10,7 @@ import { transpiler } from '@strudel/transpiler'; import { getAudioContextCurrentTime, webaudioOutput, + webaudioPrepare, resetGlobalEffects, resetLoadedSounds, initAudioOnFirstClick, @@ -59,6 +60,7 @@ export function useReplContext() { const { isSyncEnabled, audioEngineTarget } = useSettings(); const shouldUseWebaudio = audioEngineTarget !== audioEngineTargets.osc; const defaultOutput = shouldUseWebaudio ? webaudioOutput : superdirtOutput; + const defaultPrepare = shouldUseWebaudio ? webaudioPrepare : undefined; const getTime = shouldUseWebaudio ? getAudioContextCurrentTime : getPerformanceTimeSeconds; const init = useCallback(() => { @@ -67,6 +69,7 @@ export function useReplContext() { const editor = new StrudelMirror({ sync: isSyncEnabled, defaultOutput, + defaultPrepare, getTime, setInterval, clearInterval,