2017 © Pedro Peláez
 

library flac-php

PHP class for native reading FLAC's metadata and Vorbis comment

image

bluemoehre/flac-php

PHP class for native reading FLAC's metadata and Vorbis comment

  • Friday, February 24, 2017
  • by wapmorgan
  • Repository
  • 1 Watchers
  • 3 Stars
  • 1,085 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 19 % Grown

The README.md

FLAC-PHP Build Status

Class for native reading FLAC's metadata in PHP. Provides direct access to the Vorbis comment (artist, title, album, …) to fetch all desired information., (*1)

Installation

This class can easily be installed via Composer:
composer require bluemoehre/flac-php, (*2)

Alternatively you may include it the old fashioned way of downloading and adding it via
require 'Flac.php', (*3)

Usage

<?php

use bluemoehre\Flac;

header('Content-Type: text/plain;charset=utf-8');

// benchmark start
$t = microtime(true);

$flac = new Flac('mySong.flac');

// benchmark end
$t = microtime(true) - $t;

echo 'Benchmark: ' . $t .'s' . "\n\n";
echo 'Filename: ' . $flac->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, (*4)

The Versions

24/02 2017

dev-master

9999999-dev

PHP class for native reading FLAC's metadata and Vorbis comment

  Sources   Download

The Development Requires

13/02 2017

v1.0.2

1.0.2.0

PHP class for native reading FLAC's metadata

  Sources   Download

05/02 2017

dev-patch-1

dev-patch-1

PHP class for native reading FLAC's metadata

  Sources   Download