use prepare in web

This commit is contained in:
prezmop
2025-04-26 18:05:16 +09:00
parent 3a49ba6eb1
commit e4099946cd
+3
View File
@@ -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,