Contents
This module provides classes related to the sound system.
This class stores and plays sound effects. Note that this is inefficient for large music files; for those, use sge.snd.Music instead.
What sound formats are supported depends on the implementation of the SGE, but sound formats that are generally a good choice are Ogg Vorbis and uncompressed WAV. See the implementation-specific information for a full list of supported formats.
The volume of the sound as a value from 0 to 1 (0 for no sound, 1 for maximum volume).
The maximum number of instances of this sound playing permitted. If a sound is played while this number of the instances of the same sound are already playing, one of the already playing sounds will be stopped before playing the new instance. Set to None for no limit.
The file name of the sound given when it was created. (Read-only)
Reserved dictionary for internal use by the SGE. (Read-only)
Arguments:
All other arguments set the respective initial attributes of the sound. See the documentation for sge.snd.Sound for more information.
Play the sound.
Arguments:
This class stores and plays music. Music is very similar to sound effects, but only one music file can be played at a time, and it is more efficient for larger files than sge.snd.Sound.
What music formats are supported depends on the implementation of the SGE, but Ogg Vorbis is generally a good choice. See the implementation-specific information for a full list of supported formats.
Note
You should avoid the temptation to use MP3 files; MP3 is a patent-encumbered format, so many systems do not support it and royalties to the patent holders may be required for commercial use. There are many programs which can convert your MP3 files to the free Ogg Vorbis format.
The volume of the music as a value from 0 to 1 (0 for no sound, 1 for maximum volume).
The file name of the music given when it was created. (Read-only)
The current position (time) playback of the music is at in milliseconds. (Read-only)
Reserved dictionary for internal use by the SGE. (Read-only)
Arguments:
All other arguments set the respective initial attributes of the music. See the documentation for sge.snd.Music for more information.
Play the music.
Arguments:
See the documentation for sge.snd.Sound.play() for more information.
Queue the music for playback.
This will cause the music to be added to a list of music to play in order, after the previous music has finished playing.
See the documentation for sge.snd.Music.play() for more information.
Stop the currently playing music.
See the documentation for sge.snd.Sound.stop() for more information.