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

1.0 2023-09-20 09:56 UTC

This package is not auto-updated.

Last update: 2024-02-08 10:10:40 UTC



Useful links


For license info please read Resources/doc/license.txt

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

Installation via composer

Run composer to install the library:
$ composer require "laoqianjunzi/getid3: ~2.1"

Quick use example reading audio properties

namespace My\Project;

use GetId3\GetId3Core;

class MyClass
    // ...
    private function myMethod()
        $mp3File = '/path/to/my/mp3file.mp3';
        $getId3 = new GetId3Core();
        $audio = $getId3

        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);