phansys /
v2.0.0-BETA1
2012-12-04 17:31 UTC
Suggests
- ext-exif: EXIF extension is required for graphic modules.
- ext-rar: RAR extension is required for RAR archive module.
This package is auto-updated.
Last update: 2022-02-01 12:21:16 UTC
README
此GetId3库分支只在PHP +5.3.3下工作。它更新到PSR-2 / PSR-4标准,增加了命名空间,并可通过composer安装。
有用链接
许可证
有关许可证信息,请阅读LICENSE
有关商业许可证,请阅读Resources/doc/license.commercial.txt
通过composer安装
运行composer安装库
$ composer require "phansys/getid3: ^2.1@dev"
快速使用示例:读取音频属性
<?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); } }