falahati/php-mp3
Composer 安装命令:
composer require falahati/php-mp3
包简介
PHP-MP3 is a simple library for reading and manipulating MPEG audio (MP3)
README 文档
README
PHP-MP3 is a simple library for reading and manipulating MPEG audio (MP3).
This library is based on a similar project with the same name written by thegallagher which it-self was based on an script from regin.
This is not an encoder or decoder and therefore can't change the MP3 properties like bitrate, sample size, and sample rate. It's a MPEG Audio parser and therefore it should only be used to modify/create/read valid MP3 containers.
How to get
You can install and use this library with composer:
composer require falahati/php-mp3:dev-master
Features
- Correctly identifies MPEG Audio Version 1, 2 and 2.5
- Correctly identifies MPEG Audio Profile 1, 2 and 3
- Correctly extracts bitrate and sample rate information
- Correctly calculates MPEG Audio stream duration
- Frame address recovery allows the code to correctly parse corrupt data
- Trim (Cut) a MPEG Audio data and merge multiple MPEG audio streams
- Ability to strip MPEG Audio data from starting and ending ID3 (or similar) metadata information
Help me fund my own Death Star
--OR--
You can always donate your time by contributing to the project or by introducing it to others.
Samples
Strip ID3 tags from a MP3 file:
\falahati\PHPMP3\MpegAudio::fromFile("old.mp3")->stripTags()->saveFile("new.mp3");
Cut a MP3 file to extract a 30sec preview starting at the 10th second:
\falahati\PHPMP3\MpegAudio::fromFile("old.mp3")->trim(10, 30)->saveFile("new.mp3");
Append memory stored MP3 data to the end of a MP3 file:
\falahati\PHPMP3\MpegAudio::fromFile("old.mp3")->append(\falahati\PHPMP3\MpegAudio::fromData(base64_decode("/**BASE64-DATA**/")))->saveFile("new.mp3");
Extracting MP3 file total duration:
echo \falahati\PHPMP3\MpegAudio::fromFile("old.mp3")->getTotalDuration();
To Do List
- Add Unit Tests
- Ability to load and manipulate data directly from, and to a
resource - Ability to add simple ID3 metadata information to the MPEG Audio before saving
License
Copyright (C) 2017-2020 Soroush Falahati
This project is licensed under the GNU Lesser General Public License ("LGPL") and therefore can be used in closed source or commercial projects. However, any commit or change to the main code must be public and there should be a read me file along with the DLL clarifying the license and its terms as part of your project as well as a hyperlink to this repository. Read more about LGPL.
falahati/php-mp3 适用场景与选型建议
falahati/php-mp3 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 72.6k 次下载、GitHub Stars 达 49, 最近一次更新时间为 2017 年 09 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「audio」 「mp3」 「edit」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 falahati/php-mp3 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 falahati/php-mp3 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 falahati/php-mp3 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Prevents a CMS user from editing a record that another CMS user is currently editing
PHP library for handling audio/video files metadata
Library for manipulating audio files (validating, transcoding, and tagging)
A light weight Laravel package for simple operations with mp3 files
A wrapper around james-heinrich/getid3 to extract various information from media files.
PHP library to find podcasts
统计信息
- 总下载量: 72.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 50
- 点击次数: 28
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2017-09-16