bool wb_play_sound (mixed source [, string command])
Loads and plays a sound file or system sound. Parameter source may be a sound file name or a system sound constant. Parameter command may be used used to play a WAV sound synchronously or in a loop. A synchronous sound stops the currently playing sound and suspends the application control until it finishes. A MIDI soundtrack always stops any currenly playing MIDI soundtrack. To stop one or more sounds, use function wb_stop_sound().
Returns TRUE on success or FALSE otherwise.
| Value of source |
Value of command |
Meaning |
|---|---|---|
|
WAV file name |
null or empty |
Load and play the specified WAV sound file. |
|
'sync' |
Load and play the specified WAV sound file synchronously. |
|
|
'loop' |
Load and loop the specified WAV sound file. |
|
|
MIDI file name |
|
Load and play the specified MIDI file. |
|
WBC_OK |
|
Default system sound |
|
WBC_INFO |
|
System information sound |
|
WBC_WARNING |
|
Warning sound |
|
WBC_STOP |
|
Error sound |
|
WBC_QUESTION |
|
Question sound |
|
WBC_BEEP |
|
Default beep (via the computer speaker) |
wb_stop_sound
Message
and sound flags
System functions