0

anybody know how to read the first 30 seconds of an mp3 file using php, as a preview version of the original mp3?

3
Contributors
3
Replies
5
Views
8 Years
Discussion Span
Last Post by stwalcher
0

Thanks that worked..

Before, I found another version of that class online, but it didn't work properly.

Here is the code for those it would help..

header('Content-type: audio/mp3');
			header('Content-disposition: attachment; filename="afda.mp3"');
			header('X-Pad: avoid browser bug');
			header('Cache-Control: no-cache');
			include_once('mp3.php');
			$path = 'teachings/afda.mp3';
			$mp3 = new mp3($path);
			$mp3_1 = $mp3->extract(0,30);
			header('Content-length: ' . sizeof($mp3_1->str));
			echo $mp3_1->str;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.