I am working on an app where I am required to restream an audio stream coming from another link for cors reasons ( To analyze the audio and create a visuzlizer for it )
I have tried so far using the following code:
$file = 'link';
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
It was returning some random symbols and stuff that are unreadable and the audio could not be played from an audio html tag
Thanks in advance!
source https://stackoverflow.com/questions/69724350/laravel-restream-an-mp3-file-on-remote-url
Comments
Post a Comment