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.
|