Requirements

Installation

The easiest way to use mpeginfo.php is by putting it in your include_path in php.ini.

Simple Usage

<?
include("mpeginfo.php");
$mpeginfo = new mpeginfo();
$arr = $mpeginfo->getinfo("somefile.mp3");
print_r($arr);
?>

Detailed Usage

function mpeginfo($file);
function headers($file);
function v1info($file);
function v2info($file);
function getinfo($file);
mpeginfo()
The constructor. Has the following parameter:

$file
This parameter is optional and can be either a file pointer or a filename. If this parameter is omitted, you must supply it for any other member functions you call.

headers()
Returns an array of the data in the mpeg headers.
v1info()
Returns an array of the data in the id3v1 or id3v1.1 tag in the passed file.
v2info()
Returns an array of the data in the id3v2 tag in the passed file. Supports id3 versions 2.2 and later. Descriptions for keys can be fetched from the v2frames variable.
getinfo()
Returns a combined array of headers(), v1info() and v2info(). Id3v2 information is copied to the id3v1(.1) elements (title, artist, etc) only if it is longer.

Bugs

No known bugs. If you find any, please email them to me (chris at bolt dot cx).

Licence

This PHP class is released under the BSD license.

Copyright © 2001, Christopher Bolt. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.