# Web API - Download audio

**URL:** <https://community.thunkable.com/t/web-api-download-audio/2407566>\
**Category:** Web API's\
**Created:** [May 7, 2023, 10:24pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566 "2023-05-07T22:24:55Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![konyaevartyomizo](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@konyaevartyomizo](https://community.thunkable.com/u/konyaevartyomizo)\
**Post date:** [May 7, 2023, 10:24pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/1 "2023-05-07T22:24:55Z")

</div>

I need to make a request to my server, that will return an audio. I then need the app to play it. The “play it” part is easy once a have an audio file, question is how I get it.

Any supported way to get an audio from the server and then play it will work for me.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 7, 2023, 11:37pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/2 "2023-05-07T23:37:10Z")

</div>

If you don’t have a way to access an API on your server, can you store the file somewhere that has one like Cloudinary or maybe Dropbox?

---

<div class="post-metadata">

**Author:** ![konyaevartyomizo](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@konyaevartyomizo](https://community.thunkable.com/u/konyaevartyomizo)\
**Post date:** [May 8, 2023, 2:09am UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/3 "2023-05-08T02:09:55Z")

</div>

If it helps it to then download it to the device via the app an play it, I could look up a way.

---

<div class="post-metadata">

**Author:** ![konyaevartyomizo](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@konyaevartyomizo](https://community.thunkable.com/u/konyaevartyomizo)\
**Post date:** [May 8, 2023, 2:11am UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/4 "2023-05-08T02:11:50Z")

</div>

To confirm, I can access API. The issue is that don’t know how I can access the file once it sends it back in a response.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 8, 2023, 2:42am UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/5 "2023-05-08T02:42:07Z")

</div>

What format is the response that contains the audio file? Can you post an example?

---

<div class="post-metadata">

**Author:** ![konyaevartyomizo](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@konyaevartyomizo](https://community.thunkable.com/u/konyaevartyomizo)\
**Post date:** [May 8, 2023, 2:15pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/6 "2023-05-08T14:15:27Z")

</div>

I’m just about to write the server code for it. What format do I need to receive it via the Web API component and play the audio?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 8, 2023, 2:45pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/7 "2023-05-08T14:45:34Z")

</div>

Ideally, you would just use the hosted url with the Play Sound block and not need an API at all. But I guess you could try sending it an mp3 file from your API. What’s the point of that?

The documentation doesn’t mention that ability but it might work: [Sound - Thunkable Docs](https://docs.thunkable.com/sound#play)

---

<div class="post-metadata">

**Author:** ![konyaevartyomizo](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@konyaevartyomizo](https://community.thunkable.com/u/konyaevartyomizo)\
**Post date:** [May 8, 2023, 3:08pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/8 "2023-05-08T15:08:24Z")

</div>

I’ve found your thread about a similar problem:

> [@Play mp3 sound from API response](https://community.thunkable.com/t/play-mp3-sound-from-api-response/2183817):
>
> I am using an API POST call and it’s returning an mp3 file. This works fine in Postman and plays the sound but not in Thunkable Live. Can I just attach the green response block to the play block and have it play the sound? I’ve tried that and it’s not working and I’m not sure what else to try. I included the get object from JSON block and that didn’t work either. This topic makes me think it’s probably not possible: [Download mp3 and play via Sound](https://community.thunkable.com/t/download-mp3-and-play-via-sound/1440164)

 ![Screenshot 2023-05-08 at 6.06.11 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/b/fbf803f3c70d2e4ab4214dfa00b00ca4ea6e381d.png)

How did you create the “Sound1” element? What is it?

I can only see default elements in the block view, how do I create a sound element and add it to this dropdown?

 ![Screenshot 2023-05-08 at 6.08.13 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/c/bc179053252935521b22a1d2b64434b62bf6c517.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 8, 2023, 9:09pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/9 "2023-05-08T21:09:16Z")

</div>

> [@konyaevartyomizo](#):
>
> I can only see default elements in the block view, how do I create a sound element and add it to this dropdown?

I highlighted in yellow the Any Component block you’ll need in that same topic you linked to. See the second post there.

---

<div class="post-metadata">

**Author:** ![konyaevartyomizo](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@konyaevartyomizo](https://community.thunkable.com/u/konyaevartyomizo)\
**Post date:** [June 17, 2023, 7:27pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/10 "2023-06-17T19:27:02Z")

</div>

Hi again,

Thanks for helping me out here.

I’ve tried your blocks from [this](https://community.thunkable.com/t/play-mp3-sound-from-api-response/2183817) tread

 ![Screenshot 2023-06-17 at 10.19.44 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/2/122a6b96694f22dd68568170dcf3232e62438ca1.png)

It’s in the non-DnD mode. It didn’t work for playing a base64 sound.

I also tried this in the DnD mode, didn’t work either. There was no error, but there wasn’t any sound either.

 ![Screenshot 2023-06-17 at 10.23.33 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/a/4aded7eff751d81db4fdaf805fea9918f743091a.png)

Do you think there’s any mistake on these screenshots? Feels like you may be my only chance in figuring out a way to play base 64 😔

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [June 17, 2023, 7:40pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/11 "2023-06-17T19:40:57Z")

</div>

The main difference was that mine was a .wav file and yours is an .mpeg.

Can you try a .wav file?

Can you share a link to your project?

---

<div class="post-metadata">

**Author:** ![konyaevartyomizo](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@konyaevartyomizo](https://community.thunkable.com/u/konyaevartyomizo)\
**Post date:** [June 18, 2023, 11:44am UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/12 "2023-06-18T11:44:24Z")

</div>

Sure, here is the project link:  
[https://x.thunkable.com/copy/1916c22eed20bbc11ad94242ab0a161b](https://x.thunkable.com/copy/1916c22eed20bbc11ad94242ab0a161b)

Tried wav, the error code was different:

- mpeg: Failed to load sound source
- wav: Failed to load because no supported source was found

UPD: it’s working on iPhone, those errors were from the web emulator

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [June 18, 2023, 3:46pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/13 "2023-06-18T15:46:42Z")

</div>

I see the same error when I play a .wav file in a browser. And it works for me on iPhone. I’m not sure why that would be the case.

---

<div class="post-metadata">

**Author:** ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)\
**Post date:** [June 20, 2023, 1:31pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/14 "2023-06-20T13:31:45Z")

</div>

Ditto - I found this when I was trying to run in the web tester too. This only seems to work on device in my experience for some odd reason.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:33pm UTC](https://community.thunkable.com/t/web-api-download-audio/2407566/15 "2024-11-08T13:33:55Z")

</div>


