LocalFileToDataUrl -> AudioBuffer?

Is it possible to have a user select an audio file from their computer and play it back within cables?

My attempt has been using LocalFileToDataUrl to get a file from the user, passing its output into an AudioBuffer, and then having this audio file (ideally) play back using the AudioBufferPlayer.

Here’s a patch build off of example patch for the convolver op: https://cables.gl/p/604d45d7d2f02b1f1a583f7a?s=34lnUSibbpQSkWvm

Specifically:

When the LocalFileToDataUrl op is given an audio file from disk it gives me a string such as this:
“data:audio/mpeg;base64,SUQzAwAAAAAPdlRQRTEAAAARAAAB//5EAGUAcwBrAHQAbwBwAFRJVDIAAAATAAAB//5jAG8AbgB2A”

Passing this to an AudioBuffer op, I either get an error from the op: “Error: The audio file could not be loaded. Make sure the right file URL is used.” or it will pass it to the AudioBufferPlayer and play back some really GNARLY audio; clearly the original, but a totally munged and unusable audio file.

What am I doing wrong, or is this impossible with cables?

Thanks a bunch in advance!

hey, this will be in the next release, thanks for the suggestion!

Awesome, looking forward! Is there a timeline for next release?

currently still fixing some thinks, “this month” most likely. you can always try using dev.cables.gl, thinks might be temporarily broken though…

1 Like

Sweet! I look forward to it, if you need testing on anything audio and cables lemme know…