# Create an audio file in Glide from base64

**URL:** <https://community.glideapps.com/t/create-an-audio-file-in-glide-from-base64/68582>\
**Category:** Ask for Help\
**Created:** [December 11, 2023, 5:33pm UTC](https://community.glideapps.com/t/create-an-audio-file-in-glide-from-base64/68582 "2023-12-11T17:33:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nils\_Faltin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nils_faltin/32/61646_2.png) [@Nils\_Faltin](https://community.glideapps.com/u/Nils_Faltin)\
**Post date:** [December 11, 2023, 5:33pm UTC](https://community.glideapps.com/t/create-an-audio-file-in-glide-from-base64/68582/1 "2023-12-11T17:33:05Z")

</div>

I will use Google Text to Speech to create an mp3 audio file from a text I provide. But it is returned in base64 encoding. Is there an API to create a file in Glide, based on content in base64 format?

See [Base64 - Wikipedia](https://en.wikipedia.org/wiki/Base64)  
[Decode base64-encoded audio content &nbsp;|&nbsp; Cloud Text-to-Speech API &nbsp;|&nbsp; Google Cloud](https://cloud.google.com/text-to-speech/docs/base64-decoding#linux)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [December 11, 2023, 5:39pm UTC](https://community.glideapps.com/t/create-an-audio-file-in-glide-from-base64/68582/2 "2023-12-11T17:39:37Z")

</div>

Out of curiosity, if you point the audio component to that base64 result, does it still work? I think it works for images, but never tried it with audio.

---

<div class="post-metadata">

**Author:** ![Nils\_Faltin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nils_faltin/32/61646_2.png) [@Nils\_Faltin](https://community.glideapps.com/u/Nils_Faltin)\
**Post date:** [December 11, 2023, 5:44pm UTC](https://community.glideapps.com/t/create-an-audio-file-in-glide-from-base64/68582/3 "2023-12-11T17:44:32Z")

</div>

I think the audio component wants to receive a URL as text, then it will try to download a mp3 file from that address, then play the file. But I could try whether it also accepts file contents as a text in base64.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [December 11, 2023, 6:16pm UTC](https://community.glideapps.com/t/create-an-audio-file-in-glide-from-base64/68582/4 "2023-12-11T18:16:08Z")

</div>

A few of us have used base64 encoded data uri’s in various ways, so I feel that it’s possible. Based on some initial google searching it appears that people have had positive results using encoded data with html audio components, which is what Glide uses as their audio component. I don’t know if size could ever be an issue though. Maybe first try it with audio that’s only a couple of seconds long.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 12, 2023, 12:07am UTC](https://community.glideapps.com/t/create-an-audio-file-in-glide-from-base64/68582/5 "2023-12-12T00:07:24Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/0/f05a1b55b0366380f1badf0678c9bd569d6d5b05.png)

Just in case you want to switch, there’s a “Text to Speech” action in Glide.

---

<div class="post-metadata">

**Author:** ![Nils\_Faltin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nils_faltin/32/61646_2.png) [@Nils\_Faltin](https://community.glideapps.com/u/Nils_Faltin)\
**Post date:** [December 12, 2023, 10:46am UTC](https://community.glideapps.com/t/create-an-audio-file-in-glide-from-base64/68582/6 "2023-12-12T10:46:35Z")

</div>

Hi ThinDinh,

Thanks for the hint, that Glide has a built-in integration with OpenAI, including a Text-to-Speeach service. I set it up today, paying 10$ into my existing OpenAI personal trial account. And it works nicely.

English text is read aloud nearly perfect.

I also tried a German text. It is good in general, but some words are pronounced a bit like in English, like a English native speaker that has a good command of German, but still slips into pronouncing some words the English, not the German way.

Should be good enough for minimum viable product.

The cost seems to be $0.01 per API call. Too much for production use, but OK for MVP trials.

Best regards

Nils

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [December 19, 2023, 10:47am UTC](https://community.glideapps.com/t/create-an-audio-file-in-glide-from-base64/68582/7 "2023-12-19T10:47:22Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
