class Sound
sounds
.
The following code, for example, plays the sound file
ringtone.wav
:
Sound ringtone("ringtone.wav"); ringtone.play();
Constructor | |
Sound(filename) | Creates a Sound object. |
Method | |
Starts playing the sound. |
Sound(string filename);
Sound
object. The default constructor
creates an empty sound that cannot be played. The second form
initializes the sound by reading in the contents of the specified
file.
Usage:
Sound sound; Sound sound(filename);
void play();
Usage:
sound.play();