| // | Allan Hansen | // +----------------------------------------------------------------------+ // | demo.basic.php | // | getID3() demo file - showing the most basic use of getID3(). | // +----------------------------------------------------------------------+ // // $Id: demo.basic.php,v 1.3 2006/11/16 22:11:58 ah Exp $ // Enter your filename here $filename = '/data/getid3/aiff_wave.aiff'; // Include getID3() library (can be in a different directory if full path is specified) require_once('../getid3/getid3.php'); // Initialize getID3 engine $getid3 = new getID3; // Tell getID3() to use UTF-8 encoding - must send proper header as well. $getid3->encoding = 'UTF-8'; // Tell browser telling it use UTF-8 encoding as well. header('Content-Type: text/html; charset=UTF-8'); // Analyze file try { $getid3->Analyze($filename); // Show audio bitrate and length echo 'Bitrate: ' . @$getid3->info['audio']['bitrate'] . '
'; echo 'Playtime: ' . @$getid3->info['playtime_string'] . '
'; } catch (Exception $e) { echo 'An error occured: ' . $e->message; } ?>