Search code examples
phpclassmp3

Am I using the class wrong?


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....


Solution

  • 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.