I am trying to use this class to extract the first 30 seconds for a preview. Here is my code
include("class.mp3.php");
$file_input = "开发者_运维问答hat.mp3";
$file_output = "output.mp3";
$mp3 = new mp3($file_input);
$mp3_1 = $mp3->cut_mp3($file_input, $file_output, 0, 30);
hat.mp3 is in the same directory and I was expecting to see output.mp3 as the 30 second clip...any ideas what i am doing wrong of if there is an easier and better library to use for this case....
cut_mp3
function and other function get_mp3
etc uses '@' operator:
if(!$fp = @fopen($file_output, 'wb')) {
return false;
}
And you will not see any error message. First of all check permission to directory.
The Web server needs to have write permissions for the directory where you want to output your MP3. Unfortunately the class doesn't seem to have any error-handling for when it can't write the output MP3.
精彩评论