Code: Select all
<?php
$descriptorspec = array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w'));
$process = proc_open('c:/lame/lame.exe --silent --nores --mp3input -h -m s -b 128 "'.$_REQUESTї'file_to_stream'].'" -', $descriptorspec, $pipes);
if(is_resource($process))
{
while(!feof($pipesї1]) && !connection_aborted())
echo fgets($pipesї1], 1024);
fclose($pipesї0]);
fclose($pipesї1]);
proc_close($process);
}
?>It works sort of but while playing the streamed MP3...it only plays a part of the song. It's not a certain amount of time that gets cutoff the end of the song (ie. it'll play 9 seconds for one song while another could be 60 seconds). If anyone can help with this I'd appreciate it.