Skip to main content

How to display an audio file from backend in HTML and React?

I have a program where backend sends an audio file to React frontend. But it is not getting displayed as expected.

Here is the code in frontend.

enter image description here

And here is the response. The audio file is in res.data enter image description here

After doing a little research, I am displaying audio file as this: enter image description here

But it shows empty audio player. enter image description here

What am I doing wrong here, as I am getting audio file when I test it in Postman

Via Active questions tagged javascript - Stack Overflow https://ift.tt/aYqlT6Q

Comments