Allegro::Sample - Allegro digital sound routines
use Allegro; $al = Allegro->new() or die; $al->Sound(digi => 'auto') or die $al->error; $spl = $al->Sample(file => "test.wav") or die; $spl->play(loop => 1); sleep 10;
The Allegro::Sample module provides an interface to the Allegro sample routines. An Allegro module should already be initialized for this to work.
This method loads a new sample from disk.
$spl = $al->Sample(file => $filename); I<file> is the name of the file to load, and is required.
Plays sample.
$spl->play(volume => $vol, pan => $pan, freq => $freq, loop => $loop);
volume at which to play sample (0-255)
left/right panning at which to play sample (0-255). 0 is hard left, 255 is hard right.
relative frequency at which to play sample. 1000 is standard, 2000 double, 500 half, etc.
sample will loop if this option is set. use $spl->stop() to end it.
$spl->stop()
Adjusts a currently playing sample. Takes the same arguments as Allegro::Sample::play().
$spl->adjust(...);
Stops a sample.
$spl->stop;
Colin O'Leary <colino@cpan.org>
Copyright 2003 by Colin O'Leary. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The Allegro library is copyright its authors, and is giftware. See http://alleg.sf.net for more information.
To install Allegro, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Allegro
CPAN shell
perl -MCPAN -e shell install Allegro
For more information on module installation, please visit the detailed CPAN module installation guide.