X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDLx-Sound.html-inc;fp=pages%2FSDLx-Sound.html-inc;h=cb21361998a4e7013ed7a92dc932287529aa4460;hb=285d0cd289790209bcd9d141d63fd6fce74a2ee4;hp=0000000000000000000000000000000000000000;hpb=6b580206fb43261fb235c1071cee5fea29fdac79;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDLx-Sound.html-inc b/pages/SDLx-Sound.html-inc new file mode 100644 index 0000000..cb21361 --- /dev/null +++ b/pages/SDLx-Sound.html-inc @@ -0,0 +1,225 @@ +
SDLx::Sound
+ +Version 0.01_01
+ + + + + +use SDLx::Sound; + + my $snd = SDLx::Sound->new(); + + # loads and plays a single sound now + $snd->play('myfile.wav'); + + # load a single file + $snd->load('theSound.aif'); + + # plays it or all loaded files + $snd->play(); + + # more sounds + my %files = ( + chanell_01 => "/my_sound1.wav", + chanell_02 => "/my_sound2.ogg" + ); + + # times sounds bangs + my %times = ( + chanell_01 => 0, # start + chanell_01 => 1256, # miliseconds + chanell_02 => 2345 + ); + + # Load files in channels for realtime play + $snd->load(%files); + + # sets sound channel_01 loudness + $snd->loud('channel_01', 80); # loud at 80% + $snd->play(%times); # play loaded files at times + $snd->play; # play again + + # plays sound channel_01 at 578 miliseconds from now + $snd->play('channel_01', 578); + + # fades sound + $snd->fade('channel_02', 2345, 3456, -20); + + # in a single act do the wole Sound + my $snd = SDLx::Sound->new( + files => ( + chanell_01 => "/my_sound1.wav", + chanell_02 => "/my_sound2.ogg" + + ), + loud => ( + channel_01 => 80, + channel_02 => 75 + ), + times => ( + chanell_01 => 0, # start + chanell_01 => 1256, # miliseconds + chanell_02 => 2345 + ), + fade => ( + chanell_02 => [2345, 3456, -20] + ) + )->play(); + ++ +
You can think about the SDLx::Sound at 2 aproaches.
+Your application will say what the best aproach.
+In a taste that resembles to perl and to SDL, our SDLx:Sound hooks at SDL::Audio and SDL::Mixer with a gracefull and simple interface that can offer to monks a modern perlish way to manage sounds.
+An SDLx::Sound object can load sounds from filesystem, play it, adjust this loudness level or stops the sound.
+Each sound will play in the next available channel, so it can be handled isolately.
+ +Returns a new instance of SDLx::Sound
+ +Monsenhor, <ricardo.filipo at mitologica.com.br>
Please report any bugs or feature requests to bug-sdlx-sound at rt.cpan.org
, or through
+the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SDLx-Sound. I will be notified, and then you'll
+automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
+perldoc SDLx::Sound + + + + ++
You can also look for information at:
+Copyright 2010 Monsenhor.
+This program is free software; you can redistribute it and/or modify it +under the terms of either: the GNU General Public License as published +by the Free Software Foundation; or the Artistic License.
+See http://dev.perl.org/licenses/ for more information.
+ + + + + +