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 (
Simple DirectMedia Layer (
Constructs a wave object from a file or resource. Call wxSound::IsOk to determine whether this succeeded.
Destroys the wxSound object.
Constructs a wave object from a file or resource.
TRUEif the call was successful, FALSEotherwise.
bool IsOk(void) const
Returns TRUEif the object contains a successfully loaded file or resource, FALSEotherwise.
static bool IsPlaying(void) const
Returns TRUEif a sound is played at the moment.
bool Play(unsigned flags = wxSOUND_ASYNC) const
Plays the sound file. If another sound is playing, it will be interrupted. Returns TRUEon success, FALSEotherwise.
The possible values for flags are:
|wxSOUND_SYNC||Play will block and wait until the sound is replayed.|
|wxSOUND_ASYNC||Sound is played asynchronously, Play returns immediately|
|wxSOUND_ASYNC | wxSOUND_LOOP||Sound is played asynchronously and loops until another sound is played, wxSound::Stop is called or the program terminates.|
The static form is shorthand for this code:
If a sound is played, this function stops it.ymasuda 平成17年11月19日