日期:2013-12-17  浏览次数:20543 次

<?php
    /*
     * MP3 class
     *
     * rel. 0.1
     *
     * Copyright (c) 2000 Sumatra Solutions srl    http://www.sumatrasolutions.com
     *                    Ludovico Magnocavallo    ludo@sumatrasolutions.com
     *
     * License type: GNU GPL http://www.gnu.org/copyleft/gpl.html
     *
     *    Heavily inspired by
     *                    Perl Apache::MP3 module (L. Stein) -- great module to create an apache-based mp3 server
     *                    Perl MP3::Info (C. Nandor) -- very complicated, hard stuff but useful
     *                    Java class de.vdheide.mp3 (J. Vonderheide) -- great stuff, easy to read, had to debug synchronize() method
     *
     * ID3v2 tags support not completed
     *
     * MP3 header reference at http://www.mp3-tech.org/
     *
     * // quick start:
     * $mp3 = new MP3($myfilepath);
     * $mp3->get_info();                    // file info in $mp3->info array
     * $mp3->get_id3();                    // id3 info in $mp3->id3 array
     * $mp3->send_pls($HTTP_HOST)        // uses physical path to file in playlist url
     * $mp3->stream()                        // streams file to browser
     *
     * $Id: mp3.php,v 1.10 2000/07/18 11:05:16 ludo Exp $
     *
     */  
    class MP3 {
        var $id3_genres_array = array(
            'Blues', 'Classic Rock', 'Country', 'Dance', 'Disco', 'Funk', 'Grunge', 'Hip-Hop', 'Jazz', 'Metal', 'New Age', 'Oldies', 'Other', 'Pop', 'R&B', 'Rap', 'Reggae', 'Rock', 'Techno', 'Industrial',
            'Alternative', 'Ska', 'Death Metal', 'Pranks', 'Soundtrack', 'Euro-Techno', 'Ambient', 'Trip-Hop', 'Vocal', 'Jazz+Funk', 'Fusion', 'Trance', 'Classical', 'Instrumental', 'Acid', 'House',
            'Game', 'Sound Clip', 'Gospel', 'Noise', 'AlternRock', 'Bass', 'Soul', 'Punk', 'Space', 'Meditative', 'Instrumental Pop', 'Instrumental Rock', 'Ethnic', 'Gothic', 'Darkwave',
            'Techno-Industrial', 'Electronic', 'Pop-F