1SDL::Mixer(3) User Contributed Perl Documentation SDL::Mixer(3)
2
3
4
6 SDL::Mixer - a SDL perl extension
7
9 $mixer = new SDL::Mixer -frequency => MIX_DEFAULT_FREQUENCY,
10 -format => MIX_DEFAULT_FORMAT,
11 -channels => MIX_DEFAULT_CHANNELS,
12 -size => 4096;
13
15 SDL::Mixer allows you access to the SDL mixer library, enablig sound
16 and music volume setting, playing, pausing and resuming, as well as
17 fading the sound and music in and out.
18
20 new()
21
22 $mixer = SDL::Mixer->new( -frequency => MIX_DEFAULT_FREQUENCY,
23 -format => MIX_DEFAULT_FORMAT,
24 -channels => MIX_DEFAULT_CHANNELS,
25 -size => 4096);
26
27 Creates a new SDL::Mixer object. $size is the buffer size in bytes.
28
29 query_spec()
30
31 my $specs = SDL::Mixer::query_spec();
32
33 Returns a hash reference, containing the following keys and their
34 respective values:
35
36 -status
37 -frequency
38 -channels
39 -format
40
41 reserve_channels
42
43 $mixer->reserve_channels(4);
44
45 Reserve so many channels.
46
47 allocate_channels()
48
49 $mixer->reserve_channels(2);
50
51 Allocate so many channels.
52
53 group_channel(channel,group)
54
55 Group the channel number $channel into group $group.
56
57 group_channels(from,to,group)
58
59 Groups a range of channels
60
61 group_available(group)
62
63 Return true when the group is available.
64
65 group_count(group)
66
67 Returns the number of channels in the group
68
69 group_oldest()
70
71 group_newer()
72
73 play_channel()
74
75 play_music()
76
77 Play $music $loop times.
78
79 fade_in_channel(channel,chunk,loops,ms,ticks)
80
81 Fades a channel in
82
83 fade_in_music(music,loops,ms)
84
85 Fades the music in over a number of ms, looping as it does
86
87 channel_volume(channel,volume)
88
89 Sets the volume for a single channel
90
91 mucis_volume(volume)
92
93 Set the volume for the music.
94
95 halt_channel(channel)
96
97 Stops a specific channel
98
99 halt_group(group)
100
101 Stops a group of channels
102
103 halt_music()
104
105 Stops the music
106
107 channel_expire(channel,ticks)
108
109 Ignores the channel after "ticks" has expired
110
111 fade_out_channel(channel,ms)
112
113 Fade the channel number $channel in $ms ms out.
114
115 fade_out_group(group,ms)
116
117 Fade the channel group $group in $ms ms out.
118
119 fade_out_music(ms)
120
121 Fade the music in $ms ms out.
122
123 fading_music()
124
125 Return true when the music is currently fading in or out.
126
127 fading_channel()
128
129 Return true when the channel number $channel is currently fading in or
130 out.
131
132 pause( channel )
133
134 Pause the channel $channel.
135
136 resume(channel)
137
138 Resume the channel $channel.
139
140 paused()
141
142 Return true when the channel is currently paused.
143
144 pause_music()
145
146 Pause the music play.
147
148 resume_music()
149
150 Resume the music play.
151
152 rewind_music()
153
154 Resets the music file to the beginning
155
156 music_paused()
157
158 Return true when the music is currently paused.
159
160 playing()
161
162 Return true when the channel is currently playing.
163
164 playing_music ()
165
166 Return true when the music is currently playing.
167
169 David J. Goehrig, basic doc added by Tels <http://bloodgate.com>.
170
172 perl, SDL::Music and SDL::Sound.
173
174
175
176perl v5.8.8 2006-08-28 SDL::Mixer(3)