Location: PHPKode > scripts > flv2mp3 > flv2mp3/exsample.php
<?php


// @exsample
/*
 * This file I have download from youtube.com with the url
 * http://www.youtube.com/watch?v=P_gDz-Qlef0&feature=PlayList&p=E79725C3F709B278&playnext=1&index=1
*/

try {

// Path to the downloaded flv file
(string) $file = "P_gDz-Qlef0.flv";

// Load the Flv2Mp3 class
include_once( 'flv2mp3.class.php' );

// Create the $mp3 object
$mp3 = new Flv2Mp3( array( 'delete' => False ) );

// Convert the flv file into mp3
if ( $mp3->convert( $file ) ) {
	if ( is_file( $mp3->getOutfile( $file ) ) ) {
		$mp3->stream( $file );
	}
}

// If you have set the parameter delete => Fale you have
// to delete the converted file manually.
if ( is_file( $mp3->getOutfile( $file ) ) ) {
	echo $mp3->getOutfile( $file )." exist!";
}

// You can also stream the mp3 with the convert method
// if ( !$mp3->convert( $file, True ) ) {
//       echo "Can't convert ".$file;
// }
 
} catch ( Exception $error ) {

	echo "Error: <br/>\n";
	echo $error->getMessage()."<br/>\n";
	echo "Line: ".$error->getLine()." in ".$error->getFile()."<br/>\n";
	echo $error;

}


?>
Return current item: flv2mp3