Skip to content

Commit 9e9e29f

Browse files
committed
Append README: getCover (#18)
1 parent ee86090 commit 9e9e29f

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

README.md

+24-18
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This class extracts information from mpeg/mp3 audio:
1515
- Channels mode
1616
- Codec and Layer version
1717
- Frames count
18+
- Audio image (cover)
1819
- Audio tags:
1920

2021
| tag | id3v1 | id3v2 |
@@ -87,27 +88,32 @@ php bin/scan ./
8788

8889
### Audio information
8990

90-
| Property | Description | Values |
91-
|-----------------|---------------------------------------------------------------------|-------------------------------------------------------------|
92-
| `$codecVersion` | MPEG codec version | 1 or 2 |
93-
| `$layerVersion` | Audio layer version | 1 or 2 or 3 |
94-
| `$audioSize` | Audio size in bytes. Note that this value is NOT equals file size. | *int* |
95-
| `$duration` | Audio duration in seconds.microseconds | like 3603.0171428571 (means 1 hour and 3 sec) |
96-
| `$bitRate` | Audio bit rate in bps | like 128000 (means 128kb/s) |
97-
| `$sampleRate` | Audio sample rate in Hz | like 44100 (means 44.1KHz) |
98-
| `$isVbr` | Contains true if audio has variable bit rate | *boolean* |
99-
| `$channel` | Channel mode | `'stereo'` or `'dual_mono'` or `'joint_stereo'` or `'mono'` |
100-
| `$tags1` | Audio tags ver. 1 (aka id3v1). | ["song" => "Song name", "year" => 2009] |
101-
| `$tags2` | Audio tags ver. 2 (aka id3v2), only text ones. | ["TIT2" => "Long song name", ...] |
102-
| `$tags` | Combined audio tags (from id3v1 & id3v2). Keys as in tags1. | ["song" => "Long song name", "year" => 2009, ...] |
103-
| `$_parsingTime` | Contains time spent to read&extract audio information in *sec.msec* | |
91+
| Property | Description | Values |
92+
|--------------------|---------------------------------------------------------------------|-------------------------------------------------------------|
93+
| `$codecVersion` | MPEG codec version | 1 or 2 |
94+
| `$layerVersion` | Audio layer version | 1 or 2 or 3 |
95+
| `$audioSize` | Audio size in bytes. Note that this value is NOT equals file size. | *int* |
96+
| `$duration` | Audio duration in seconds.microseconds | like 3603.0171428571 (means 1 hour and 3 sec) |
97+
| `$bitRate` | Audio bit rate in bps | like 128000 (means 128kb/s) |
98+
| `$sampleRate` | Audio sample rate in Hz | like 44100 (means 44.1KHz) |
99+
| `$isVbr` | Contains `true` if audio has variable bit rate | *boolean* |
100+
| `$hasCover` | Contains `true` if audio has a bundled image | *boolean* |
101+
| `$channel` | Channel mode | `'stereo'` or `'dual_mono'` or `'joint_stereo'` or `'mono'` |
102+
| `$tags1` | Audio tags ver. 1 (aka id3v1). | ["song" => "Song name", "year" => 2009] |
103+
| `$tags2` | Audio tags ver. 2 (aka id3v2), only text ones. | ["TIT2" => "Long song name", ...] |
104+
| `$tags` | Combined audio tags (from id3v1 & id3v2). Keys as in tags1. | ["song" => "Long song name", "year" => 2009, ...] |
105+
| `$coverProperties` | Information about a bundled with audio image. | ["mime_type" => "image/jpeg", "picture_type" => 1, ...] |
106+
| `$_parsingTime` | Contains time spent to read&extract audio information in *sec.msec* | |
104107

105108
### Class methods
106-
- `public function __construct($filename, $parseTags = false)`
107-
Creates new instance of object and initiate parsing. If second argument is *true*, audio tags also will be parsed.
109+
- `$audio = new Mp3Info($filename, $parseTags = false)`
110+
Creates new instance of object and initiate parsing. If you need to parse audio tags (id3v1 and id3v2), pass `true` as second argument is.
108111

109-
- `static public function isValidAudio($filename)`
110-
Checks if file `$filename` looks like an mp3-file. Returns **true** if file similar to mp3, otherwise false.
112+
- `$audio->getCover()`
113+
Returns raw content of bundled with audio image.
114+
115+
- `Mp3Info::isValidAudio($filename)`
116+
Static method that checks if file `$filename` looks like a mp3-file. Returns `true` if file looks like a mp3, otherwise false.
111117

112118
## Technical information
113119
Supporting features:

0 commit comments

Comments
 (0)