Sound¶
Contents
Sounds¶
-
serge.sound.Sounds¶ The registry of all sounds (is an AudioRegistry)
Music¶
-
serge.sound.Music¶ The registry of all music (is a MusicStore)
AudioRegistry¶
-
class
serge.sound.AudioRegistry[source]¶ Bases:
serge.registry.GeneralStore,serge.common.EventAwareRegistry for audio
SoundItem¶
-
class
serge.sound.SoundItem(path=None, sound=None)[source]¶ Bases:
objectRepresents a sound item
Parameters: path – the path to the sound file -
fadeout(time)[source]¶ Fadeout the sound
Parameters: time – the time over which the sound fades out in seconds (0=immediate)
-
play(loops=0)[source]¶ Play the music
Parameters: loops – the number of times to loop the sound (0=do not loop, -1=loop forever)
-
MusicStore¶
-
class
serge.sound.MusicStore[source]¶ Bases:
serge.sound.AudioRegistryStores music
-
fadeout(time)[source]¶ Fadeout the currently playing track
Parameters: time – the time over which the music fades out in seconds (0=immediate)
-
isPlayingSong(name)[source]¶ Return True if the named song is playing
Parameters: name – the name of the music item
-