Inheritance diagram for wx.Sound:
This class represents a short sound (loaded from Windows WAV file), that can be stored in memory and played.
Currently this class is implemented on Windows and Unix (and uses either Open Sound System or Simple DirectMedia Layer).
Constructs a wave object from a file. Call IsOk to determine whether this succeeded.
Parameters:
Returns:
Constructs a wave object from a file.
Returns True if the call was successful, False otherwise.
Parameters:
Returns:
bool
Parameters:
Returns:
bool
Returns True if the object contains a successfully loaded file or resource, False otherwise.
Returns:
bool
Plays the sound file. If another sound is playing, it will be interrupted.
Returns True on success, False otherwise.
Parameters:
flags (int): The possible values for flags are:
Sound Flags |
Description |
---|---|
wx.SOUND_SYNC |
Play will block and wait until the sound is replayed. |
wx.SOUND_ASYNC |
Sound is played asynchronously, Play returns immediately. |
wx.SOUND_ASYNC | wx.SOUND_LOOP |
Sound is played asynchronously and loops until another sound is played, Stop is called or the program terminates. |
Returns:
bool
Note
Note that in general it is possible to delete the object which is being asynchronously played any time after calling this function and the sound would continue playing, however this currently doesn’t work under Windows for sound objects loaded from memory data.
Plays the sound from the file filename. If another sound is playing, it will be interrupted.
Returns True on success, False otherwise.
Parameters: