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 (using either Open Sound System or Simple DirectMedia Layer).
Sound.new(String fileName, Boolean isResource = false)
Constructs a sound object from a WAV file or, under Windows only, from a Windows resource. Will raise an exception if the file is not found, or if there is an error loading the file.
boolean Sound.is_playing()
Returns true if a sound is being played at the moment.
This method is currently not implemented under Windows.
boolean Sound.play(String fileName, Integer flags = Wx::SOUND_ASYNC)
Shorthand class method for playing a sound file. See Sound#play for more information on the arguments to this method
Sound.stop()
If any sound is being played, this method stops it.
boolean is_ok()
Returns true if the object contains a successfully loaded file or resource, false otherwise.
boolean play(Integer flags = Wx::SOUND_ASYNC)
Plays the sound file. If another sound is playing, it will be interrupted. Returns true on success, false otherwise.
The possible values for flags are:
Wx::SOUND_SYNC : Play will block and wait until the sound is replayed.Wx::SOUND_ASYNC : Sound is played asynchronously, Play returns immediatelywxSOUND_ASYNC|wxSOUND_LOOP : Sound is played asynchronously and loops until another sound is played, wxSound::Stop is called or the program terminates.[This page automatically generated from the Textile source at Wed Sep 09 02:21:23 +0100 2009]