Possible Duplicate:
Automatically trimming a mp3 in PHP
I am currently serving mp3 files via php like the method described in this question: Can I serve MP3 files with PHP?
$track = "sometrack.mp3";
if(file_exists($track)) {
header("Content-Transfer-Encoding: binary");
header("Content-Type: audio/mpeg, audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3");
header('Content-length: ' . filesize($track));
header('Content-Disposition: filename="sometrack.mp3"');
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');
print file_get_contents($track);
} else {
echo "no file";
}
How can I server a cut mp3. Like I want to take out the first XX seconds in the file and directly serve it from XX seconds so that the user only gets it from the XX seconds and not from the 00 seconds