Skip to content
/ GetId3 Public
forked from pinxi/getid3

This fork of GetId3 library updates to PSR-2 / PSR-4 standards, adds namespaces and makes it installable by composer

License

Notifications You must be signed in to change notification settings

phansys/GetId3

 
 

Repository files navigation

GetId3

Build Status

This fork of GetId3 library only works in PHP +5.3.3. It updates to PSR-2 / PSR-4 standards, adds namespaces and makes it installable by composer.

Useful links

License

For license info please read LICENSE

For commercial license read Resources/doc/license.commercial.txt

Installation via composer

Run composer to install the library:
$ composer require "phansys/getid3: ^2.1@dev"

Quick use example reading audio properties

<?php
namespace My\Project;

use \GetId3\GetId3Core as GetId3;

class MyClass
{
    // ...
    private function myMethod()
    {
        $mp3File = '/path/to/my/mp3file.mp3';
        $getId3 = new GetId3();
        $audio = $getId3
            ->setOptionMD5Data(true)
            ->setOptionMD5DataSource(true)
            ->setEncoding('UTF-8')
            ->analyze($mp3File)
        ;

        if (isset($audio['error'])) {
            throw new \RuntimeException(sprintf('Error at reading audio properties from "%s" with GetId3: %s.', $mp3File, $audio['error']));
        }
        $this->setLength(isset($audio['playtime_seconds']) ? $audio['playtime_seconds'] : '');

        // var_dump($audio);
    }
}

About

This fork of GetId3 library updates to PSR-2 / PSR-4 standards, adds namespaces and makes it installable by composer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.9%
  • CSS 0.1%