Messenger Plus! Live - Scripting Documentation
The MsgPlus::PlaySound function plays a sound asynchronously. It
can also be used to stop the current sound from playing.
Syntax
[boolean] PlaySound(
[string] SoundFile
[number,optional] MaxPlayTime
);
Parameters
- SoundFile
- [string] Path to the sound file to play. The path is relative to the script's
directory by default, to override this behavior, prefix the path
with "\". Example: "\C:\directory\sound.mp3". If
this string is empty, the current sound playing is stopped and the
function returns.
- MaxPlayTime
- [number, optional] If specified, this parameter sets a maximum
play time for the sound, in milliseconds. If the time specified is
longer than the sound, the sound will be played to its end.
Return Value
A boolean value specifying if the sound started to play successfully
(or if a sound was stopped when SoundFile
is an empty string).
This function typically fails for the following reason:
- The sound file type is not supported. See Remarks.
Remarks
If a sound that was started by this function is already playing, it
is stopped before the new sound starts playing.
Here is a list of sound file types supported by Messenger Plus!. This support
is possible thanks in part to the
LibSndFile
and Lame MP3
libraries:
- Microsoft WAV, Sphere Nist (*.wav)
- MPEG Audio (*.mp1;*.mp2;*.mp3)
- Amiga (*.iff;*.svx)
- Apple/SGI (*.aif)
- Berkeley/Ircam (*.sf)
- Creative Labs (*.voc)
- Ensoniq Paris (*.paf)
- GNU Octave (*.mat4;*.mat5)
- Sound Forge (*.w64)
- Sun/Next (*.au;*.snd)
- Free Lossless Audio Codec (*.fla;*.flac)
- Apple CAF (*.caf)
Function Information
Object |
MsgPlus |
Availability |
Messenger Plus! Live 4.00 |
See Also
MsgPlus Object.