1 Star 0 Fork 0

劳谦君子 / GetID3库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.md 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
劳谦君子 提交于 2023-09-20 17:56 . 代码初始化

GetId3

Useful links

License

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

<?php
namespace My\Project;

use GetId3\GetId3Core;

class MyClass
{
    // ...
    private function myMethod()
    {
        $mp3File = '/path/to/my/mp3file.mp3';
        $getId3 = new GetId3Core();
        $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);
    }
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/laoqianjunzi/GetID3.git
git@gitee.com:laoqianjunzi/GetID3.git
laoqianjunzi
GetID3
GetID3库
master

搜索帮助