Update README.md

This commit is contained in:
Sergey 2020-05-07 00:33:39 +03:00 committed by GitHub
parent 26384fb5a2
commit 5f7d54fa69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,15 +27,16 @@ This class extracts information from mpeg/mp3 audio:
| track | track | TRCK | | track | track | TRCK |
| genre | genre | TCON | | genre | genre | TCON |
1. Usage # Content
2. Performance 1. [Usage](#usage)
3. Console scanner 2. [Performance](#performance)
4. API 3. [Console scanner](#console-scanner)
4. [API](#api)
- Audio information - Audio information
- Class methods - Class methods
4. Technical information 4. [Technical information](#technical-information)
# Usage ## Usage
After creating an instance of `Mp3Info` with passing filename as the first argument to the constructor, you can retrieve data from object properties (listed below). After creating an instance of `Mp3Info` with passing filename as the first argument to the constructor, you can retrieve data from object properties (listed below).
```php ```php
@ -69,20 +70,20 @@ echo 'Song '.$audio->tags2['TIT2'].' from '.$audio->tags2['TPE1'].PHP_EOL;
echo 'Song '.$audio->tags['song'].' from '.$audio->tags['artist'].PHP_EOL; echo 'Song '.$audio->tags['song'].' from '.$audio->tags['artist'].PHP_EOL;
``` ```
# Performance ## Performance
* Typically it parses one mp3-file with size around 6-7 mb in less than 0.001 sec. * Typically it parses one mp3-file with size around 6-7 mb in less than 0.001 sec.
* List of 112 files with constant & variable bitRate with total duration 5:22:28 are parsed in 1.76 sec. *getId3* library against exactly the same mp3 list works for 8x-10x slower - 9.9 sec. * List of 112 files with constant & variable bitRate with total duration 5:22:28 are parsed in 1.76 sec. *getId3* library against exactly the same mp3 list works for 8x-10x slower - 9.9 sec.
* If you want, there's a very easy way to compare. Just install `nass600/get-id3` package and run console scanner against any folder with audios. It will print time that Mp3Info spent and that getId3. * If you want, there's a very easy way to compare. Just install `nass600/get-id3` package and run console scanner against any folder with audios. It will print time that Mp3Info spent and that getId3.
# Console scanner ## Console scanner
To test Mp3Info you can use built-in script that scans dirs and analyzes all mp3-files inside them. To launch script against current folder: To test Mp3Info you can use built-in script that scans dirs and analyzes all mp3-files inside them. To launch script against current folder:
```bash ```bash
php bin/scan ./ php bin/scan ./
``` ```
# API ## API
### Audio information ### Audio information