Erick Calder > POE-Component-Enc-Mp3-1.2 > POE::Component::Enc::Mp3

Download:
POE-Component-Enc-Mp3-1.2.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.2   Source  

NAME ^

POE::Component::Enc::Mp3 - mp3 encoder wrapper

SYNOPSIS ^

use POE qw(Component::Enc::Mp3);

$mp3 = POE::Component::Enc::Mp3->new($bitrate => 160); $mp3->enc("/tmp/tst.wav");

POE::Kernel->run();

DESCRIPTION ^

This POE component encodes raw audio files into mp3 format. It is merely a wrapper for the notlame program.

METHODS ^

The module provides an object oriented interface as follows:

new

Used to initialise the system and create a module instance. The following parameters are available:

alias

Indicates the name of a session to which module callbacks are posted. Default: main.

bitrate

Should be self-evident. If left unspecified, defaults to 160.

enc <file-name> [del-orig]

Encodes the given file, naming it with a .mp3 extension. An optional true value for the second parameter indicates that the original file should be deleted.

    e.g. $mp3->enc("/tmp/tst.wav");

CALLBACKS ^

Callbacks are made to the session indicated in the spawn() method. The names of the functions called back may also be set via the aforementioned method. The following callbacks are issued:

status

Fired during processing. ARG0 is the block number being processed whilst ARG1 represents the percentage of completion expressed as a whole number between 0 and 100.

done

This callback is made upon completion of encoding.

error

Fired on the event of an error.

AUTHOR ^

Erick Calder <ecalder@cpan.org>

My gratitude to Rocco Caputo and Matt Cashner whose code has helped me put this together.

DATE ^

$Date: 2002/09/14 22:36:06 $

VERSION ^

$Revision: 1.2 $

LICENSE AND COPYRIGHT ^

Copyright (c) 2002 Erick Calder. This product is distributed under the MIT License. A copy of this license was included in a file called LICENSE. If for some reason, this file was not included, please see http://www.opensource.org/licenses/mit-license.html to obtain a copy of this license.

syntax highlighting: