> Ah yeah dataviews, but you still need to convert from json to those and that takes about as much overhead
You don't necessarily need to have an intermediate JSON representation. Many of the built in APIs in Node and browsers return array buffers natively. For example:
const buffer = await fetch('foo.wav').then(res => res.arrayBuffer())
new Worker('worker.js').postMessage(buffer, [buffer])
This completely transfers the buffer to the worker thread, after which it is detached (unusable from the sending side) [1][2].[1] https://developer.mozilla.org/en-US/docs/Web/API/Worker/post...
[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...