Audio::FLAC::Header (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
Audio::FLAC::Header - interface to FLAC header metadata.SYNOPSIS
use Audio::FLAC::Header; my $flac = Audio::FLAC::Header->new("song.flac"); my $info = $flac->info(); foreach (keys %$info) { print "$_: $info->{$_}\n"; } my $tags = $flac->tags(); foreach (keys %$tags) { print "$_: $tags->{$_}\n"; }
DESCRIPTION
This module returns a hash containing basic information about a
ALBUM ARTIST TITLE DATE GENRE TRACKNUMBER COMMENT
The information returned by Audio::FLAC::info is keyed by:
MINIMUMBLOCKSIZE MAXIMUMBLOCKSIZE MINIMUMFRAMESIZE MAXIMUMFRAMESIZE TOTALSAMPLES SAMPLERATE NUMCHANNELS BITSPERSAMPLE MD5CHECKSUM
Information stored in the main hash that relates to the file itself or is calculated from some of the information fields is keyed by:
trackLengthMinutes : minutes field of track length trackLengthSeconds : seconds field of track length trackLengthFrames : frames field of track length (base 75) trackTotalLengthSeconds : total length of track in fractional seconds bitRate : average bits per second of file fileSize : file size, in bytes
CONSTRUCTORS
new ($filename)
Opens aINSTANCE METHODS
- *
-
info( [$key] )
Returns a hashref containing information about the
FLACfile from the file's information header.The optional parameter, key, allows you to retrieve a single value from the info hash. Returns "undef" if the key is not found.
- *
-
tags( [$key] )
Returns a hashref containing tag keys and values of the
FLACfile from the file's Vorbis Comment header.The optional parameter, key, allows you to retrieve a single value from the tag hash. Returns "undef" if the key is not found.
- *
-
cuesheet( )
Returns an arrayref which contains a textual representation of the cuesheet metada block. Each element in the array corresponds to one line in a .cue file. If there is no cuesheet block in this
FLACfile the array will be empty. The resulting cuesheet should match the output of metaflac's --export-cuesheet-to option, with the exception of theFILEline, which includes the actual file name instead of ``dummy.wav''. - *
-
seektable( )
Returns the seektable. Currently disabled for performance.
- *
-
application( $appId )
Returns the application block for the passed id.
- *
-
picture( [$type ] )
Returns a hash containing data from a
PICTUREblock if found.Defaults to type 3 - ``Front Cover''
When the passed variable is 'all', an array of hashes containing picture data from all
PICTUREblocks is returned. Allows for multiple instances of the same picture type. - *
-
set_separator( )
For multi-value
ID3tags, set the separator string. Defaults to '/' - *
-
vendor_string( )
Returns the vendor string.
- *
-
set_vendor_string( $string )
Set the vendor string. Will be written on write()
- *
-
write( )
Writes the current contents of the tag hash to the
FLACfile, given that there's enough space in the header to do so. If there's insufficient space available (using pre-existing padding), the file will remain unchanged, and the function will return a zero value.
SEE ALSO
<flac.sourceforge.net/format.html>AUTHORS
Dan Sully, <daniel@cpan.org>COPYRIGHT
Pure perl code Copyright (c) 2003-2004, Erik Reckase.Pure perl code Copyright (c) 2003-2007, Dan Sully & Slim Devices. Pure perl code Copyright (c) 2008-2009, Dan Sully
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.