I need to fetch an audio file using Ajax and receive it in the form an array of bytes. My backend is on PHP.
Currently I am using
<?php
echo file_get_contents("./mainFile.mp3");
?>
This lets me return the audio file in the form an array of bytes. But how can I receive it in Javascript as a byte array. I referred this link on SO
But this does not seem to be the proper way. Can anyone please suggest something ???