2017 © Pedro Peláez
 

library php-mp3

PHP-MP3 is a simple library for reading and manipulating MPEG audio (MP3)

image

falahati/php-mp3

PHP-MP3 is a simple library for reading and manipulating MPEG audio (MP3)

  • Wednesday, November 1, 2017
  • by falahati
  • Repository
  • 2 Watchers
  • 7 Stars
  • 71 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 19 Forks
  • 1 Open issues
  • 3 Versions
  • 27 % Grown

The README.md

PHP-MP3

, (*1)

PHP-MP3 is a simple library for reading and manipulating MPEG audio (MP3)., (*2)

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., (*3)

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., (*4)

How to get

, (*5)

You can install and use this library with composer:, (*6)

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

, (*7)

--OR--, (*8)

You can always donate your time by contributing to the project or by introducing it to others., (*9)

Samples

Strip ID3 tags from a MP3 file:, (*10)

\falahati\PHPMP3\MpegAudio::fromFile("old.mp3")->stripTags()->saveFile("new.mp3");

Cut a MP3 file to extract a 30sec preview starting at the 10th second:, (*11)

\falahati\PHPMP3\MpegAudio::fromFile("old.mp3")->trim(10, 30)->saveFile("new.mp3");

Append memory stored MP3 data to the end of a MP3 file:, (*12)

\falahati\PHPMP3\MpegAudio::fromFile("old.mp3")->append(\falahati\PHPMP3\MpegAudio::fromData(base64_decode("/**BASE64-DATA**/")))->saveFile("new.mp3");

Extracting MP3 file total duration:, (*13)

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, (*14)

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., (*15)

The Versions

01/11 2017

dev-master

9999999-dev https://github.com/falahati/PHP-MP3

PHP-MP3 is a simple library for reading and manipulating MPEG audio (MP3)

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

audio mp3 edit

01/11 2017

v0.9.5-alpha2

0.9.5.0-alpha2 https://github.com/falahati/PHP-MP3

PHP-MP3 is a simple library for reading and manipulating MPEG audio (MP3)

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

audio mp3 edit

17/09 2017

v0.9.5-alpha1

0.9.5.0-alpha1 https://github.com/falahati/PHP-MP3

PHP-MP3 is a simple library for reading and manipulating MPEG audio (MP3)

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.4

 

The Development Requires

audio mp3 edit