wxSoundThis 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). Derived from Include files <wx/sound.h> Members
wxSound::wxSound
wxSound::wxSoundwxSound() Default constructor. wxSound(const wxString& fileName, bool isResource = false) Constructs a wave object from a file or, under Windows, from a Windows resource. Call wxSound::IsOk to determine whether this succeeded. Parameters fileName
isResource
wxSound::~wxSound~wxSound() Destroys the wxSound object.
wxSound::Createbool Create(const wxString& fileName, bool isResource = false) Constructs a wave object from a file or resource. Parameters fileName
isResource
Return value true if the call was successful, false otherwise.
wxSound::IsOkbool IsOk() const Returns true if the object contains a successfully loaded file or resource, false otherwise.
wxSound::IsPlayingstatic bool IsPlaying() const Returns true if a sound is played at the moment. This method is currently not implemented under Windows.
wxSound::Playbool Play(unsigned flags = wxSOUND_ASYNC) const static bool Play(const wxString& filename, unsigned flags = wxSOUND_ASYNC) Plays the sound file. If another sound is playing, it will be interrupted. Returns true on success, false otherwise. 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. The possible values for flags are:
The static form is shorthand for this code:
wxSound(filename).Play(flags); wxSound::Stopstatic void Stop() If a sound is played, this function stops it.
|