~ubuntu-branches/ubuntu/gutsy/pygame/gutsy

« back to all changes in this revision

Viewing changes to docs/ref/Channel.html

  • Committer: Bazaar Package Importer
  • Author(s): Ed Boraas
  • Date: 2002-02-20 06:39:24 UTC
  • Revision ID: james.westby@ubuntu.com-20020220063924-amlzj7tqkeods4eq
Tags: upstream-1.4
ImportĀ upstreamĀ versionĀ 1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<title>Channel</title>
 
3
<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
 
4
 
 
5
 
 
6
<table cellspacing=3 width=100%><tr><td bgcolor=#00000>
 
7
<table width=100%><tr><td bgcolor=c2fc20 align=center>
 
8
    <a href=http://www.pygame.org>
 
9
    <img src=../pygame_tiny.gif border=0 width=200 height=60></a><br>
 
10
    <b>pygame&nbsp;&nbsp;&nbsp;documentation</b>
 
11
</td><td bgcolor=6aee28 align=center valign=top width=100%>
 
12
 
 
13
        ||&nbsp;
 
14
        <a href=http://www.pygame.org>Home</a> &nbsp;||&nbsp;
 
15
        <a href=../index.html>Help Contents</a> &nbsp;||
 
16
        <br>&nbsp;<br>
 
17
 
 
18
|| <a href=pygame.html>pygame</a> || 
 
19
<a href=pygame_cdrom.html>cdrom</a> || 
 
20
<a href=pygame_constants.html>constants</a> || 
 
21
<a href=pygame_display.html>display</a> || 
 
22
<a href=pygame_draw.html>draw</a> || 
 
23
<a href=pygame_event.html>event</a> ||<br>
 
24
|| <a href=pygame_font.html>font</a> || 
 
25
<a href=pygame_image.html>image</a> || 
 
26
<a href=pygame_joystick.html>joystick</a> || 
 
27
<a href=pygame_key.html>key</a> || 
 
28
<a href=pygame_mixer.html>mixer</a> || 
 
29
<a href=pygame_mixer_music.html>mixer_music</a> ||<br>
 
30
|| <a href=pygame_mouse.html>mouse</a> || 
 
31
<a href=pygame_movie.html>movie</a> || 
 
32
<a href=pygame_surfarray.html>surfarray</a> || 
 
33
<a href=pygame_time.html>time</a> || 
 
34
<a href=pygame_transform.html>transform</a> ||<br>
 
35
&nbsp;<br>|| <a href=CD.html>CD</a> || 
 
36
<a href=Channel.html>Channel</a> || 
 
37
<a href=Clock.html>Clock</a> || 
 
38
<a href=Font.html>Font</a> || 
 
39
<a href=Joystick.html>Joystick</a> || 
 
40
<a href=Movie.html>Movie</a> ||<br>
 
41
|| <a href=Rect.html>Rect</a> || 
 
42
<a href=Sound.html>Sound</a> || 
 
43
<a href=Surface.html>Surface</a> ||<br>
 
44
&nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
 
45
<a href=pygame_sprite.html>sprite</a> || 
 
46
<a href=pygame_version.html>version</a> ||<br>
 
47
 
 
48
 
 
49
</td></tr></table></td></tr></table>
 
50
<br>
 
51
<h2 align=center>Channel</h2>
 
52
Channel objects represent a single channel of sound. Each channel
 
53
can only playback one Sound object at a time. If your application
 
54
only requires simply sound playback, you will usually not need to
 
55
bother with the Channel objects, they exist for finer playback
 
56
control.
 
57
<br>&nbsp;<br>
 
58
Sound objects can be retrieved from the pygame.mixer module with
 
59
functions like <a href=pygame_mixer.html#Channel>pygame.mixer.Channel()</a> and
 
60
<a href=pygame_mixer.html#find_channel>pygame.mixer.find_channel()</a>. Also, each time you call
 
61
<a href=Sound.html#play>Sound.play()</a> a Channel object will be returned, representing the
 
62
channel that sound is playing on.
 
63
 
 
64
<hr>
 
65
 
 
66
<table>
 
67
<tr><td><a href=#fadeout>fadeout</a></td><td> -
 
68
fade out the channel</td></tr>
 
69
 
 
70
 
 
71
<tr><td><a href=#get_busy>get_busy</a></td><td> -
 
72
query state of the channel</td></tr>
 
73
 
 
74
 
 
75
<tr><td><a href=#get_volume>get_volume</a></td><td> -
 
76
query the volume for the</td></tr>
 
77
 
 
78
 
 
79
<tr><td><a href=#pause>pause</a></td><td> -
 
80
temporarily stop the channel</td></tr>
 
81
 
 
82
 
 
83
<tr><td><a href=#play>play</a></td><td> -
 
84
play a sound on this channel</td></tr>
 
85
 
 
86
 
 
87
<tr><td><a href=#set_volume>set_volume</a></td><td> -
 
88
set volume for channel</td></tr>
 
89
 
 
90
 
 
91
<tr><td><a href=#stop>stop</a></td><td> -
 
92
stop playing on the channel</td></tr>
 
93
 
 
94
 
 
95
<tr><td><a href=#unpause>unpause</a></td><td> -
 
96
restart a paused channel</td></tr>
 
97
 
 
98
 
 
99
</table>
 
100
 
 
101
<hr>
 
102
 
 
103
<a name=fadeout><font size=+2><b>fadeout
 
104
</b></font><br><font size=+1><tt>
 
105
Channel.fadeout(millisec) -> None
 
106
</tt></font><ul>
 
107
Fade out the playing sound and stops it over the
 
108
given milliseconds.
 
109
</ul><br>&nbsp;<br>
 
110
 
 
111
<a name=get_busy><font size=+2><b>get_busy
 
112
</b></font><br><font size=+1><tt>
 
113
Channel.get_busy() -> bool
 
114
</tt></font><ul>
 
115
Returns true when there is a sound actively playing on this
 
116
channel.
 
117
</ul><br>&nbsp;<br>
 
118
 
 
119
<a name=get_volume><font size=+2><b>get_volume
 
120
</b></font><br><font size=+1><tt>
 
121
Channel.get_volume() -> val
 
122
</tt></font><ul>
 
123
Returns the current volume for this sound object. The value is
 
124
between 0.0 and 1.0.
 
125
</ul><br>&nbsp;<br>
 
126
 
 
127
<a name=pause><font size=+2><b>pause
 
128
</b></font><br><font size=+1><tt>
 
129
Channel.pause() -> None
 
130
</tt></font><ul>
 
131
Stops the sound that is playing on this channel,
 
132
but it can be resumed with a call to <a href=#unpause>unpause()</a>
 
133
</ul><br>&nbsp;<br>
 
134
 
 
135
<a name=play><font size=+2><b>play
 
136
</b></font><br><font size=+1><tt>
 
137
Channel.play(Sound, [loops, [maxtime]]) -> None
 
138
</tt></font><ul>
 
139
Starts playing a given sound on this channel. If the channels is
 
140
currently playing a different sound, it will be
 
141
replaced/restarted with the given sound. Loops controls how many
 
142
extra times the sound will play, a negative loop will play
 
143
indefinitely, it defaults to 0. Maxtime is the number of
 
144
totalmilliseconds that the sound will play. It defaults to
 
145
forever (-1).
 
146
</ul><br>&nbsp;<br>
 
147
 
 
148
<a name=set_volume><font size=+2><b>set_volume
 
149
</b></font><br><font size=+1><tt>
 
150
Channel.set_volume(val) -> None
 
151
</tt></font><ul>
 
152
Sets the volume for the channel. The channel's volume level is
 
153
mixed with the volume for the active sound object. The value is
 
154
between 0.0 and 1.0.
 
155
</ul><br>&nbsp;<br>
 
156
 
 
157
<a name=stop><font size=+2><b>stop
 
158
</b></font><br><font size=+1><tt>
 
159
Channel.stop() -> None
 
160
</tt></font><ul>
 
161
Stops the sound that is playing on this channel.
 
162
</ul><br>&nbsp;<br>
 
163
 
 
164
<a name=unpause><font size=+2><b>unpause
 
165
</b></font><br><font size=+1><tt>
 
166
Channel.unpause() -> None
 
167
</tt></font><ul>
 
168
Restarts a paused channel where it was paused.
 
169
</ul><br>&nbsp;<br>
 
170
 
 
171
 
 
172
<hr>
 
173
</body></html>