Read/Write MP3-Tags
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
MP3
Tests
.gitignore
.travis.yml
README.md
package.xml
phpunit.xml

README.md

This package provides handling of MP3 tags.

Build Status

Requirements:

  1. PHP >= 5.2
  2. PEAR
  3. MP3_Id
  4. MP3_IDv2

Warning! Due to the outdated design PEAR::isError, in some cases, PHP generates E_STRICT warning

Example:

<?php
set_include_path(dirname(__FILE__) . '/PEAR');
require_once 'MP3/Id3.php';

$id3 = new MP3_Id3('./file2.mp3');
$tags = $id3->getTags();

echo '<pre>';

print_r($id3->getMeta());

foreach ($tags as $k => $v) {
    if ($k === 'picture') {
        echo '<img src="data:' . $v->getMime() . ';base64,' . base64_encode($v->getData()) . '" alt="picture" />';
    } else {
        print_r($k . ' - ' . print_r($v, true));
    }
    echo "\n";
}

$tags->setComment('test2');
$tags->setGenreId(23);
$tags->setUrl('http://wapinet.ru');
$tags->setAlbumArtist('test');
//$id3->write();

echo '</pre>';