Playing audio file fetched from HTTP POST response

I have an API endpoint where I send a POST request which returns an mp3 file as application/octet-stream Content-Type. On fetching the response, I would like to play the audio file using the expo-av module.

I’ve seen similar questions on this forum trying the approach of saving the file and then playing it from local storage. Is that possible to do if the file has to be fetched with a POST request?

Is it possible for the Audio.Sound.createAsync method to be fed bytes directly? Are there any examples?

I have control over the API described so can make changes to it but the mp3 file is created on the fly so I need a solution that doesn’t require a static mp3 file being hosted on a URL somewhere.

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