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 $mixer = SDL::Mixer->new( -frequency => MIX_DEFAULT_FREQUENCY,
22 -format => MIX_DEFAULT_FORMAT,
23 -channels => MIX_DEFAULT_CHANNELS,
24 -size => 4096);
25
26 Creates a new SDL::Mixer object. $size is the buffer size in bytes.
27
28 query_spec()
29 my $specs = SDL::Mixer::query_spec();
30
31 Returns a hash reference, containing the following keys and their
32 respective values:
33
34 -status
35 -frequency
36 -channels
37 -format
38
39 reserve_channels
40 $mixer->reserve_channels(4);
41
42 Reserve so many channels.
43
44 allocate_channels()
45 $mixer->reserve_channels(2);
46
47 Allocate so many channels.
48
49 group_channel(channel,group)
50 Group the channel number $channel into group $group.
51
52 group_channels(from,to,group)
53 Groups a range of channels
54
55 group_available(group)
56 Return true when the group is available.
57
58 group_count(group)
59 Returns the number of channels in the group
60
61 group_oldest()
62 group_newer()
63 play_channel()
64 play_music()
65 Play $music $loop times.
66
67 fade_in_channel(channel,chunk,loops,ms,ticks)
68 Fades a channel in
69
70 fade_in_music(music,loops,ms)
71 Fades the music in over a number of ms, looping as it does
72
73 channel_volume(channel,volume)
74 Sets the volume for a single channel
75
76 mucis_volume(volume)
77 Set the volume for the music.
78
79 halt_channel(channel)
80 Stops a specific channel
81
82 halt_group(group)
83 Stops a group of channels
84
85 halt_music()
86 Stops the music
87
88 channel_expire(channel,ticks)
89 Ignores the channel after "ticks" has expired
90
91 fade_out_channel(channel,ms)
92 Fade the channel number $channel in $ms ms out.
93
94 fade_out_group(group,ms)
95 Fade the channel group $group in $ms ms out.
96
97 fade_out_music(ms)
98 Fade the music in $ms ms out.
99
100 fading_music()
101 Return true when the music is currently fading in or out.
102
103 fading_channel()
104 Return true when the channel number $channel is currently fading in or
105 out.
106
107 pause( channel )
108 Pause the channel $channel.
109
110 resume(channel)
111 Resume the channel $channel.
112
113 paused()
114 Return true when the channel is currently paused.
115
116 pause_music()
117 Pause the music play.
118
119 resume_music()
120 Resume the music play.
121
122 rewind_music()
123 Resets the music file to the beginning
124
125 music_paused()
126 Return true when the music is currently paused.
127
128 playing()
129 Return true when the channel is currently playing.
130
131 playing_music ()
132 Return true when the music is currently playing.
133
135 David J. Goehrig, basic doc added by Tels <http://bloodgate.com>.
136
138 perl, SDL::Music and SDL::Sound.
139
140
141
142perl v5.12.0 2010-05-06 SDL::Mixer(3)