We currently have a Spring Boot java Backend paired with a Vue.js frontend. The backend's API code utilizes an external API to fetch MP3 files, which are then accessed by the frontend through calls to the backend API for playback. However, there have been instances of browsers exhibiting inconsistent behavior where they fail to play the MP3 due to CORS issues.
To address this issue, my intention is to have the backend handle the file downloading process and return bytes to the frontend instead. As someone who is fairly new to frontend development, I am interested in knowing the most effective way to download the MP3 from the backend, the optimal format for sending the MP3 file to the frontend, and how to convert these bytes into playable MP3 files using JavaScript (specifically within Vue).
It should be noted that the size of the files is extremely small, with the MP3 files being less than 5 seconds in duration, and therefore there is no need to store the files on the server.