GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEMPLATE::PLUGIN::MP3 (3)

.ds Aq ’

NAME

Template::Plugin::MP3 - Interface to the MP3::Info Module

CONTENTS

SYNOPSIS



    [% USE mp3 = MP3("Montana.mp3") %]

    [% mp3.title %]
    [% mp3.album %]

    # perldoc MP3::Info for more ideas



DESCRIPTION

Template::Plugin::MP3 provides a simple wrapper for using MP3::Info in object oriented mode; see MP3::Info for more details.

CONSTRUCTOR and CONFIGURATION

Template::Plugin::MP3 takes a filename as its primary argument:



    [% USE MP3("Tryin_To_Grow_A_Chin.mp3") %]



Optional configuration info can also be specified in the constructor:



    [% USE MP3("Camarillo_Brillo.mp3", utf8 => 1, dir => "/mp3") %]



The name of the file can also be specified as a named parameter (name):



    [% USE MP3(name => "A_Token_Of_My_Extreme.mp3", dir => "/mp3") %]



Template::Plugin::MP3 understands the following options:
<B>nameB> The name of the MP3 file. Note that if both a positional argument and a name parameter are passed the positional argument will take precedence.
<B>dirB> Specify a base directory name; will be prepended to the filename, if it is defined.
<B>utf8B> Determines whether results should be returned in UTF-8, as handled by MP3::Info’s use_mp3_utf8() function. See use_mp3_utf8 in MP3::Info. Note that this requires Unicode::String.
If the constructor cannot create an instance using the filename passed, a plugin.mp3 Exception is thrown, which will need to be caught appropriately:



    [% TRY %]
        [% USE mp3 = MP3("Willie The Pimp.mp3") %]
    [% CATCH plugin.mp3 %]
        Cant find that MP3; are you sure you spelled it right?
    [% CATCH %]
        Unexpected exception: [% error %]
    [% END %]



METHODS

Template::Plugin::MP3 provides the following, mostly intuitive, methods:
<B>fileB> Name of the file.
<B>artistB> Name of the artist.
<B>albumB> Name of the album.
<B>bitrateB> Bitrate at which the mp3 was encoded.
<B>sizeB> Size of the file, in bytes.
<B>timeB>, <B>secsB>, <B>mmB>, <B>ssB>, <B>msB> Length of the song, in various permutations. For example:
<B>timeB> 03:37
<B>secsB> 217.0253125
<B>mmB> 3
<B>ssB> 27
<B>msB> 25.3125000000125
<B>genreB> Genre of the MP3.
<B>tagversionB> Full name of the version of the MP3 tag, e.g. ID3v1.1
<B>versionB> Version of the MP3 tag: 1 or 2
MP3::Info defines some other fields that I don’t grok; try



    [% MP3.Dump %]



to see them all.

Of course, all of the above methods don’t return the advertised value if the tag being read does not contain useful information.

OTHER STUFF

Template::Plugin::MP3 provides access to the @mp3_genres and @winamp_genres arrays via the mp3_genres() and winamp_genres() class methods, or collectively through the genres() class method:



    [% FOREACH genre = MP3.genres %]
       * [% genre;
    END %]



AUTHORS

darren chamberlain <darren@cpan.org>

Doug Gorley <douggorley@shaw.ca>

COPYRIGHT

(C) 2003 darren chamberlain

This library is free software; you may distribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Template::Plugin, MP3::Info
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MP3 (3) 2003-06-24

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.