mirror of
https://codeberg.org/uzu/strudel
synced 2026-09-05 06:57:35 -04:00
use prepare in web
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user