PHP Streaming Audio
github.com
github.com
I found some poorly documentation on the winamp website. And basically it comes down to this: - you recode the MP3 to the lower bitrate - get rid of all headers - concatenate all audio into one big stream - inject every x bytes a "StreamTitle=[title]" regardless of frames
Very simple format.
That said, I'm not discounting anything done here. I've had to do deep dives on streaming video before. Even built my own h264 streaming protocol prior to HLS and DASH being introduced more than a decade ago now. Figuring out the format, finding obscure documentation on the file headers, figuring out how request and send it in pieces, hell just finding documentation that long ago... it's not easy. And at least when I did it, I was working on PHP 5.4 which had namespaces. This was likely built on 5.2 if I had a guess, which lacked that luxury
This wasn't a problem 12 years back as then Apache's mod_php had been the default way to serve pages. Your http server was the PHP interpreter.
Note that if enabled you need to disable gzip compression too since that has its own buffering.
Buffering can still be accomplished php side when needed with ob_ functions.
There are newer standards that do actually use individual requests for each segment, this is how you do it with web video.
header("Content-Length: ".$settings["max_listen_time"] * $settings["bitrate"] * 128); //suppreses chuncked transfer-encoding