Audio::AudiereUse the Audiere sound library in Perl | |
Download |
Audio::Audiere Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Tels
- Publisher web site:
- http://search.cpan.org/~tels/
Audio::Audiere Tags
Audio::Audiere Description
Use the Audiere sound library in Perl Audio::Audiere is a class to use the Audiere sound library in Perl.SYNOPSIS use Audio::Audiere qw/AUDIO_STREAM AUDIO_BUFFER/; use strict; use warnings; my $audiere = Audio::Audiere->new(); if ($audiere->error()) { die ("Cannot get audio device: ". print $audiere->error()); } # now we have the driver, add some sound streams # stream the sound from the disk my $stream = $audiere->addStream( 'media/sample.ogg', AUDIO_STREAM); # always check for errors: if ($stream->error()) { print "Cannot load sound: ", $stream->error()," "; } # load sound into memory (if possible), this is also the default my $sound = $audiere->addStream( 'media/effect.wav', AUDIO_BUFFER); # always check for errors: if ($sound->error()) { print "Cannot load sound: ", $sound->error()," "; } $stream->setVolume(0.5); # 50% $stream->setRepeat(1); # loooop if ($stream->isSeekable()) { $stream->setPosition(100); # skip some bit } $stream->play(); # start playing $sound->play(); # start playing # free sound device is not neccessary, will be done automatically Requirements: · Perl
Audio::Audiere Related Software