NAME

Audio::APE - An object-oriented interface to Monkey's Audio file information and APE tag fields, implemented entirely in Perl.

SYNOPSIS

use Audio::APE;
my $mac = Audio::APE->new("song.ape");

foreach (keys %$mac) {
	print "$_: $mac->{$_}\n";
}

my $macTags = $mac->tags();

foreach (keys %$macTags) {
	print "$_: $macTags->{$_}\n";
}

DESCRIPTION

This module returns a hash containing basic information about a Monkey's Audio file, as well as tag information contained in the Monkey's Audio file's APE tags. See Audio::APETags for more information about the tags.

The information returned by Audio::APE is keyed (for different MAC versions) by:

Version 3.97 or earlier: Flags => { MONKEY_FLAG_8_BIT MONKEY_FLAG_WAV_NOT_STORED MONKEY_FLAG_24_BIT MONKEY_FLAG_SEEK_ELEMENTS MONKEY_FLAG_PEAK_LEVEL MONKEY_FLAG_CRC }, SampleRate : sample rate of uncompressed data in Hz (usually 44100) startHeaderInfo : offset for header info compression : compression scheme (string) Channels : Mono or Stereo streamVersion : Monkey's Audio version used for compression TotalSamples : calculated total samples in file bitRate : bitrate in bps duration : duration of track in seconds fileSize : filesize in bytes filename : filename with path BlocksPerFrame : number of blocks in a frame (usually 73728)

Version 3.98+ adds the following: Flags : reserved for later (not the same as 3.97) DescriptorBytes : Size of v3.98+ Descriptor block Bits : bits per sample (usually 16)

CONSTRUCTORS

  • new( $filename )

    Opens a Monkey's Audio file, ensuring that it exists and is actually an Monkey's Audio stream, then loads the information and comment fields.

INSTANCE METHODS

  • info( [$key] )

    Returns a hashref containing information about the Monkey's Audio file 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 Monkey's Audio file from the file's APE tags.

    The optional parameter, key, allows you to retrieve a single value from the tag hash. Returns undef if the key is not found.

SEE ALSO

http://www.monkeysaudio.com/

AUTHOR

Dan Sully, <daniel@cpan.org>

Kevin Deane-Freeman, <kevindf at shaw dot ca>, based on other work by Erik Reckase, <cerebusjam at hotmail dot com>, and Dan Sully, <daniel@cpan.org>

COPYRIGHT

Copyright (c) 2005-2007, Dan Sully & Slim Devices

Copyright (c) 2004, Kevin Deane-Freeman.

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.