pygame / docs / ref / Sound.html

Full commit
<body bgcolor=#dddddd text=#333377 link=#7777bb vlink=#7777bb>

<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=#f5f5f5><tr valign=top>
<td rowspan=2><table border=0 cellpadding=5 cellspacing=0 bgcolor=#333377>
<tr height=86 align=left><td valign=middle><font color=#ffffff size=+5>
	<a href=../index.html><font size=+5 color=#ffffff><i><b>
<td valign=middle><tt><font color=#dddddd><br>
</td></tr></table></td><td width=100% align=center valign=middle>

	<a href=>Home</a> &nbsp;||&nbsp;
	<a href=../index.html>Help Contents</a> &nbsp;||

|| <a href=CD.html>CD</a> || 
<a href=Channel.html>Channel</a> || 
<a href=Font.html>Font</a> || 
<a href=Joystick.html>Joystick</a> || 
<a href=Rect.html>Rect</a> || 
<a href=Sound.html>Sound</a> || 
<a href=Surface.html>Surface</a> ||<br>
|| <a href=pygame.html>pygame</a> || 
<a href=pygame_cdrom.html>cdrom</a> || 
<a href=pygame_constants.html>constants</a> || 
<a href=pygame_display.html>display</a> || 
<a href=pygame_event.html>event</a> || 
<a href=pygame_font.html>font</a> || 
<a href=pygame_image.html>image</a> ||<br>
|| <a href=pygame_joystick.html>joystick</a> || 
<a href=pygame_key.html>key</a> || 
<a href=pygame_mixer.html>mixer</a> || 
<a href=pygame_mixer_music.html>mixer_music</a> || 
<a href=pygame_mouse.html>mouse</a> || 
<a href=pygame_surfarray.html>surfarray</a> || 
<a href=pygame_time.html>time</a> ||<br>

<h2 align=center>Sound</h2>
Sound objects represent actual sound data. Sound objects are
created from the function pygame.mixer.load(). Sound objects can
be playing on multiple channels simultaneously. Calling functions
like Sound.stop() from the sound objects will effect all channels
playing that Sound object.
All sound objects have the same frequency and format as the
pygame.mixer module's initialization.


<tr><td><a href=#fadeout>fadeout</a></td><td> -
fadeout all channels playing this sound</td></tr>

<tr><td><a href=#get_num_channels>get_num_channels</a></td><td> -
number of channels with sound</td></tr>

<tr><td><a href=#get_volume>get_volume</a></td><td> -
query volume for sound</td></tr>

<tr><td><a href=#play>play</a></td><td> -
play sound</td></tr>

<tr><td><a href=#set_volume>set_volume</a></td><td> -
change volume for sound</td></tr>

<tr><td><a href=#stop>stop</a></td><td> -
stop all channels playing this sound</td></tr>



<a name=fadeout><font size=+2><b>fadeout
</b></font><br><font size=+1><tt>
Sound.fadeout(millisec) -> None
Fade out all the playing channels playing this sound over the.
All channels playing this sound will be stopped after the given

<a name=get_num_channels><font size=+2><b>get_num_channels
</b></font><br><font size=+1><tt>
Sound.get_num_channels() -> int
Returns the number of channels that have been using this sound.
The channels may have already finished, but have not started
playing any other sounds.

<a name=get_volume><font size=+2><b>get_volume
</b></font><br><font size=+1><tt>
Sound.get_volume() -> val
Returns the current volume for this sound object. The value is
0.0 to 1.0.

<a name=play><font size=+2><b>play
</b></font><br><font size=+1><tt>[loops, [maxtime]]) -> Channel
Starts playing a song on an available channel. If no channels are
available, it will not play and return None. Loops controls how
many extra times the sound will play, a negative loop will play
indefinitely, it defaults to 0. Maxtime is the number of total
milliseconds that the sound will play. It defaults to forever
Returns a channel object for the channel that is selected to play
the sound.

<a name=set_volume><font size=+2><b>set_volume
</b></font><br><font size=+1><tt>
Sound.set_volume(val) -> None
Set the play volume for this sound. This will effect any channels
currently playing this sound, along with all subsequent calls to
play. The value is 0.0 to 1.0.

<a name=stop><font size=+2><b>stop
</b></font><br><font size=+1><tt>
Sound.stop() -> None
This will instantly stop all channels playing this sound.