3 <h3 id="TOP">Index</h3>
5 <ul><li><a href="#NAME">NAME</a></li>
6 <li><a href="#CATEGORY">CATEGORY</a></li>
7 <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
8 <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
9 <li><a href="#METHODS">METHODS</a>
10 <ul><li><a href="#new">new</a></li>
11 <li><a href="#load">load</a></li>
12 <li><a href="#play">play</a></li>
13 <li><a href="#pause">pause</a></li>
14 <li><a href="#resume">resume</a></li>
15 <li><a href="#stop">stop</a></li>
18 <li><a href="#AUTHORS">AUTHORS</a></li>
19 <li><a href="#COPYRIGHT_amp_LICENSE">COPYRIGHT & LICENSE</a>
24 <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
25 <div id="NAME_CONTENT">
29 <h1 id="CATEGORY">CATEGORY</h1><p><a href="#TOP" class="toplink">Top</a></p>
30 <div id="CATEGORY_CONTENT">
34 <h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
35 <div id="SYNOPSIS_CONTENT">
36 <pre> use SDLx::Sound;
38 my $snd = SDLx::Sound->new();
40 # loads and plays a single sound now
41 $snd->play('myfile.wav');
44 $snd->load('theSound.aif');
46 # plays it or all loaded files
51 chanell_01 => "/my_sound1.wav",
52 chanell_02 => "/my_sound2.ogg"
57 chanell_01 => 0, # start
58 chanell_01 => 1256, # miliseconds
62 # Load files in channels for realtime play
63 $snd->load(%files);
65 # sets sound channel_01 loudness
66 $snd->loud('channel_01', 80); # loud at 80%
67 $snd->play(%times); # play loaded files at times
68 $snd->play; # play again
70 # plays sound channel_01 at 578 miliseconds from now
71 $snd->play('channel_01', 578);
74 $snd->fade('channel_02', 2345, 3456, -20);
76 # in a single act do the wole Sound
77 my $snd = SDLx::Sound->new(
79 chanell_01 => "/my_sound1.wav",
80 chanell_02 => "/my_sound2.ogg"
88 chanell_01 => 0, # start
89 chanell_01 => 1256, # miliseconds
93 chanell_02 => [2345, 3456, -20]
100 <h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
101 <div id="DESCRIPTION_CONTENT">
106 <p>You can think about the SDLx::Sound at 2 aproaches. </p>
108 <dt>* A simple sound or </dt>
109 <dt>* The sound of your game or app. </dt>
111 <p>Your application will say what the best aproach.</p>
112 <p>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.</p>
113 <p>An SDLx::Sound object can load sounds from filesystem, play it, adjust this loudness level or stops the sound. </p>
114 <p>Each sound will play in the next available channel, so it can be handled isolately.</p>
117 <h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
118 <div id="METHODS_CONTENT">
121 <h2 id="new">new</h2>
122 <div id="new_CONTENT">
123 <p>Returns a new instance of SDLx::Sound</p>
126 <h2 id="load">load</h2>
127 <div id="load_CONTENT">
134 <h2 id="play">play</h2>
135 <div id="play_CONTENT">
136 <pre> $sdlx_sound->play('file.wav');
142 <h2 id="pause">pause</h2>
143 <div id="pause_CONTENT">
146 <h2 id="resume">resume</h2>
147 <div id="resume_CONTENT">
150 <h2 id="stop">stop</h2>
151 <div id="stop_CONTENT">
158 <h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
159 <div id="AUTHORS_CONTENT">
160 <p>See <b>AUTHORS</b> in <cite>SDL</cite>.</p>
163 <h1 id="COPYRIGHT_amp_LICENSE">COPYRIGHT & LICENSE</h1><p><a href="#TOP" class="toplink">Top</a></p>
164 <div id="COPYRIGHT_amp_LICENSE_CONTENT">
165 <p>This program is free software; you can redistribute it and/or modify it
166 under the same terms as Perl itself.</p>