|
Controls loading, mixing, and playing the sounds.
Having seperate classes allows different groups of sounds to be
loaded, and unloaded from memory easily. Useage:
sm = SoundManager()
sm.Load()
|
Methods
|
|
GetSound
Load
Play
PlayMusic
Stop
StopAll
Update
__init__
_debug
|
|
|
GetSound
|
GetSound ( self, name )
Returns a Sound object for the given name.
|
|
|
Load
|
Load (
self,
sound_list=[],
sound_path=".",
)
Loads sounds.
|
|
|
Play
|
Play (
self,
name,
volume=[ 1.0, 1.0 ],
wait=0,
loop=0,
)
Plays the sound with the given name.
name - of the sound.
volume - left and right. Ranges 0.0 - 1.0
wait - used to control what happens if sound is allready playing:
0 - will not wait if sound playing. play anyway.
1 - if there is a sound of this type playing wait for it.
2 - if there is a sound of this type playing do not play again.
loop - number of times to loop. -1 means forever.
|
|
|
PlayMusic
|
PlayMusic ( self, musicname )
Plays a music track. Only one can be played at a time.
So if there is one playing, it will be stopped and the new
one started.
|
|
|
Stop
|
Stop ( self, name )
|
|
|
StopAll
|
StopAll ( self )
stops all sounds.
|
|
|
Update
|
Update ( self, elapsed_time )
|
|
|
__init__
|
__init__ (
self,
sound_list=SOUND_LIST,
sound_path=SOUND_PATH,
)
|
|
|
_debug
|
_debug (
self,
x,
debug_level=0,
)
|
|