From 1fd9ba5dbfad00c0986332e958be7b27f872c532 Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Sat, 1 Jun 2024 12:11:28 -0400 Subject: [PATCH] convert to blob --- website/src/repl/idbutils.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/website/src/repl/idbutils.mjs b/website/src/repl/idbutils.mjs index 54f98216..a6b19179 100644 --- a/website/src/repl/idbutils.mjs +++ b/website/src/repl/idbutils.mjs @@ -64,7 +64,7 @@ export function registerSamplesFromDB(config = userSamplesDBConfig, onComplete = //fallback to file name before period and seperator if no parent directory splitRelativePath[splitRelativePath.length - 2] ?? soundFile.id.split(/\W+/)[0] ?? 'user'; - const soundPath = bufferToDataUrl(soundFile.buf); + const soundPath = blobToDataUrl(soundFile.blob); // const soundPath = soundFile.blob; const soundPaths = sounds.get(parentDirectory) ?? new Set(); @@ -164,16 +164,16 @@ async function processFilesForIDB(files) { const sUrl = URL.createObjectURL(s); //fetch the sound and turn it into a buffer array return fetch(sUrl).then((res) => { - return res.arrayBuffer().then((buf) => { + return res.blob().then((blob) => { const path = s.webkitRelativePath; let id = path?.length ? path : title; - if (id == null || title == null || buf == null) { + if (id == null || title == null || blob == null) { return; } return { title, - buf, - // blob: base64, + // buf, + blob, id, }; });