From 5425c0681d2139d33ff681e1d53f00ce1305961b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 20:49:59 +0000 Subject: [PATCH 1/2] Initial plan From 100c5e295a4f086fa449da8d4d3da0e248bf369e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 20:51:54 +0000 Subject: [PATCH 2/2] fix: support blob audio worklet modules Agent-Logs-Url: https://github.com/audiojs/web-audio-api/sessions/57c51b1b-5fcc-4dbe-b167-ba23468d731c Co-authored-by: dy <300067+dy@users.noreply.github.com> --- src/AudioWorklet.js | 4 ++++ test/AudioWorklet.test.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/AudioWorklet.js b/src/AudioWorklet.js index 04afefd..9a5edc3 100644 --- a/src/AudioWorklet.js +++ b/src/AudioWorklet.js @@ -376,6 +376,10 @@ class AudioWorklet { return meta.includes('base64') ? atob(body) : decodeURIComponent(body) } + if (url.startsWith('blob:')) { + return await fetch(url).then(res => res.text()) + } + // Dynamic import fs/path — works in Node.js, throws in browser let fs, path try { fs = await import('fs'); path = await import('path') } catch { diff --git a/test/AudioWorklet.test.js b/test/AudioWorklet.test.js index 0835e2b..a084b61 100644 --- a/test/AudioWorklet.test.js +++ b/test/AudioWorklet.test.js @@ -160,6 +160,22 @@ test('AudioWorklet > addModule with base64 data URI', async () => { ok(node, 'base64 data URI works') }) +test('AudioWorklet > addModule with blob URI', async () => { + let ctx = await mkCtx() + let code = `class P extends AudioWorkletProcessor { + process() { return true } + }; registerProcessor('blob-proc', P)` + let url = URL.createObjectURL(new Blob([code], { type: 'text/javascript' })) + + try { + await ctx.audioWorklet.addModule(url) + let node = new AudioWorkletNode(ctx, 'blob-proc') + ok(node, 'blob URI works') + } finally { + URL.revokeObjectURL(url) + } +}) + test('AudioWorklet > message ports are entangled', async () => { let ctx = await mkCtx() await ctx.audioWorklet.addModule(scope => scope.registerProcessor('msg', AudioWorkletProcessor))