Вы отправляете заголовок в неправильном направлении.Что вы сделали, так это сообщили исходному серверу, что вы будете отправлять ему audio/mpeg
в GET-запросе - что в любом случае недопустимо, GET-запросы не содержат содержимого.Что вам действительно нужно сделать, это отправить его клиенту, который будет получать контент.
Вам не нужен контекст потока для этой задачи - попробуйте этот код:
<?php
// Try and open the remote stream
if (!$stream = fopen('http://example.com/audio.mp3', 'r')) {
// If opening failed, inform the client we have no content
header('HTTP/1.1 500 Internal Server Error');
exit('Unable to open remote stream');
}
// It's probably an idea to remove the execution time limit - on Windows hosts
// this could result in the audio stream cutting off mid-flow
set_time_limit(0);
// Inform the client we will be sending it some MPEG audio
header('Content-Type: audio/mpeg');
// Send the data
fpassthru($stream);