Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# MP3File
Using the MP3File Class you can calculate the MP3 file duration in PHP, aware of id3v1, id3v2, CBR, VBR
#### This code is from: [Zenwoods - PHP Calculate Duration of MP3](http://www.zedwood.com/article/php-calculate-duration-of-mp3)

---

## Getting Started
> Installing using Composer
>```sh
>composer require mp3file/mp3file
>```

## How to load:
> Load the Package using Composer
>```php
>require_once("autoload.php");
>use MP3File\MP3File;
>```

>Load the Package **not** using Composer (Downloaded from Github)
>```php
>require_once("PHP_MP3_Duration/src/class.mp3file.php");
>use MP3File\MP3File;
>```

## Class in Action
>Get the Duration of a File (Little bit Longer Process Time, Shorter Code, Composer)
>```php
>require_once("autoload.php");
>use MP3File\MP3File;
>echo MP3File::getTime("[Your MP3 File].mp3");
>```

>Get the Duration of a File (Shorter Process Time, Longer Code, Composer)
>```php
>require_once("autoload.php");
>use MP3File\MP3File;
>$file = new MP3File("[Your MP3 File].mp3");
>echo $file->getDurationEstimate();
>``
30 changes: 28 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
{
"name": "php_mp3_duration/php_mp3_duration",
"name": "mp3file/mp3file",
"type": "library",
"description": "get duration of a mp3 file",
"description": "Using the MP3File Class you can calculate the MP3 file duration in PHP, aware of id3v1, id3v2, CBR, VBR",
"keywords": [
"MP3",
"MP3 Duration"
],
"license": "MIT",
"authors": [
{
"name": "Zedwood",
"homepage": "http://www.zedwood.com/article/127/php-calculate-duration-of-mp3"
},
{
"name": "Noah Halstead",
"email": "[email protected]"
}
],
"repositories": [
{
"type": "git",
"url": "https:\/\/github.com\/mk-j\/PHP_MP3_Duration"
}
],
"require": {
"php": "^5.3.3 || ^7.0"
},
"autoload": {
"psr-4": {
"MP3File\\": "src"
}
}
}
186 changes: 0 additions & 186 deletions mp3file.class.php

This file was deleted.

Loading