How to handle base64 audio?

Hello everyone. Maybe I am missing something but I have tried a variety of things so I wanted to get your ideas.

What is the best practice when it comes to playing audio in ReTool? I am using the ElevanLabs API and an getting audio I would like to play in the form of base64 code.

I would like to be able to now provide the user with a very simple player to play the audio. I was surprised that ReTool doesn't seem to have an audio widget.

How would you recommend I handle base64 audio with a simple player? Keep in mind that the ElavanLabs doesn't provide a "file" per se it's simple a chunk of base64 audio.

Thank you.

The utils.playSound API supports base64 audio now. Try something like

utils.playSound('data:audio/mpeg;base64,SUQzAgAAAAAQP1RUM...AAA')

Unfortunately can't share the entire string due to message size limits but if you need it, DM and I can try different formats.

If you are on iOS make sure the MIME type is accurate or it will not work. Every other platform seems to do type sniffing.

@bca -- this works well for me on a computer but not on a tablet device. Is this supposed to be the case? I am on self-hosted retool (at whatever the latest stable release is. 3.33 I think)

Hi @bg1900, our latest stable release is 3.52-stable. Could you please confirm if this is the version where you are experiencing the issue?

yes, sorry I just confirmed I am running the 3.52-stable release

Thanks for confirming! I'm creating a repro app on that version right now. I'll update you soon :slight_smile:

1 Like

Here is a public repro where anyone following this topic can get a base64 to test: Base64 encoded audio file. · GitHub

I was able to reproduce this issue both on Cloud and Self-hosted v3.52-stable, we created the bug report. We'll update you here when it's fixed.

1 Like

great, thanks for the quick investigation!

you are welcome!