https://github.com/bluemoehre/flac-php
PHP class for native reading FLAC's metadata
https://github.com/bluemoehre/flac-php
flac metadata php vorbis-comment
Last synced: 6 months ago
JSON representation
PHP class for native reading FLAC's metadata
- Host: GitHub
- URL: https://github.com/bluemoehre/flac-php
- Owner: bluemoehre
- License: gpl-2.0
- Created: 2012-07-30T18:57:03.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2024-10-15T14:32:05.000Z (over 1 year ago)
- Last Synced: 2025-10-25T12:33:15.325Z (8 months ago)
- Topics: flac, metadata, php, vorbis-comment
- Language: PHP
- Homepage:
- Size: 1.11 MB
- Stars: 8
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
FLAC-PHP [](https://github.com/bluemoehre/flac-php/actions/workflows/ci.yml)
========
Class for native reading FLAC's metadata in PHP.
Provides direct access to the Vorbis comment (artist, title, album, …) to fetch all desired information.
Installation
------------
This class can easily be installed via [Composer](https://getcomposer.org):
`composer require bluemoehre/flac-php`
Alternatively you may include it the old fashioned way of downloading and adding it via
`require 'Flac.php'`
Usage
-----
```php
getFilename() . "\n";
echo 'File size: ' . $flac->getFileSize() . " Bytes\n";
echo 'Meta-Blocks: '; print_r($flac->getMetadataBlockCounts()); echo "\n";
echo 'Sample Rate: ' . $flac->getSampleRate() . "\n";
echo 'Channels: ' . $flac->getChannels() . "\n";
echo 'Bits per sample: ' . $flac->getBitsPerSample() . "\n";
echo 'Total samples: ' . $flac->getTotalSamples() . "\n";
echo 'Duration: ' . $flac->getDuration() . "s\n";
echo 'MD5 checksum (audio data): ' . $flac->getAudioMd5() . "\n";
echo 'Vorbis-Comment: '; nl2br(print_r($flac->getVorbisComment())); echo "\n";
```
TODOs
-----
- Add getter for pictures
Technical information
---------------------
FLAC: https://xiph.org/flac/format.html
Vorbis comment: https://www.xiph.org/vorbis/doc/v-comment.html