diff --git a/packages/superdough/superdough.mjs b/packages/superdough/superdough.mjs index e663fc6d..018caa9a 100644 --- a/packages/superdough/superdough.mjs +++ b/packages/superdough/superdough.mjs @@ -99,7 +99,7 @@ export const connectToDestination = (input, channels = [0, 1]) => { //This upmix can be removed if correct channel counts are set throughout the app, // and then strudel could theoretically support surround sound audio files const stereoMix = new StereoPannerNode(ctx); - input?.connect(stereoMix); + input.connect(stereoMix); const splitter = new ChannelSplitterNode(ctx, { numberOfOutputs: stereoMix.channelCount, diff --git a/website/src/repl/idbutils.mjs b/website/src/repl/idbutils.mjs index c49362da..f5cbf52b 100644 --- a/website/src/repl/idbutils.mjs +++ b/website/src/repl/idbutils.mjs @@ -56,19 +56,24 @@ export function registerSamplesFromDB(config = userSamplesDBConfig, onComplete = // Files used to be uploaded as base64 strings, After Jan 1 2025 this check can be safely deleted if (typeof blob === 'string') { - return blob; + const soundPaths = sounds.get(parentDirectory) ?? new Set(); + soundPaths.add(blob); + sounds.set(parentDirectory, soundPaths); + return; } return blobToDataUrl(blob).then((soundPath) => { const soundPaths = sounds.get(parentDirectory) ?? new Set(); soundPaths.add(soundPath); sounds.set(parentDirectory, soundPaths); + return; }); }), ) .then(() => { sounds.forEach((soundPaths, key) => { const value = Array.from(soundPaths); + registerSound(key, (t, hapValue, onended) => onTriggerSample(t, hapValue, onended, value), { type: 'sample', samples: value,