#include <wx/sound.h>

Currently this class is implemented on Windows and Unix (and uses either Open Sound System or Simple DirectMedia Layer).
| bool | Play (unsigned flags=wxSOUND_ASYNC) const |
| static bool | Play (const wxString &filename, unsigned flags=wxSOUND_ASYNC) |
Public Member Functions | |
| wxSound () | |
| wxSound (const wxString &fileName, bool isResource=false) | |
| virtual | ~wxSound () |
| bool | Create (const wxString &fileName, bool isResource=false) |
| bool | IsOk () const |
Static Public Member Functions | |
| static bool | IsPlaying () const |
| static void | Stop () |
| wxSound::wxSound | ( | ) |
Default ctor.
| wxSound::wxSound | ( | const wxString & | fileName, | |
| bool | isResource = false | |||
| ) |
Constructs a wave object from a file or, under Windows, from a Windows resource. Call IsOk() to determine whether this succeeded.
| fileName | The filename or Windows resource. | |
| isResource | true if fileName is a resource, false if it is a filename. |
| virtual wxSound::~wxSound | ( | ) | [virtual] |
Destroys the wxSound object.
| bool wxSound::Create | ( | const wxString & | fileName, | |
| bool | isResource = false | |||
| ) |
Constructs a wave object from a file or resource.
| fileName | The filename or Windows resource. | |
| isResource | true if fileName is a resource, false if it is a filename. |
| bool wxSound::IsOk | ( | ) | const |
Returns true if the object contains a successfully loaded file or resource, false otherwise.
| static bool wxSound::IsPlaying | ( | ) | const [static] |
Returns true if a sound is played at the moment. This method is currently not implemented under Windows.
| bool wxSound::Play | ( | unsigned | flags = wxSOUND_ASYNC |
) | const |
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:
Play will block and wait until the sound is replayed.Play returns immediately.The static form is shorthand for this code:
wxSound(filename).Play(flags);
| static bool wxSound::Play | ( | const wxString & | filename, | |
| unsigned | flags = wxSOUND_ASYNC | |||
| ) | [static] |
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:
Play will block and wait until the sound is replayed.Play returns immediately.The static form is shorthand for this code:
wxSound(filename).Play(flags);
| static void wxSound::Stop | ( | ) | [static] |
If a sound is played, this function stops it.
|
[ top ] |