Register forum user name Search FAQ

MUSHclient scripting

Description of MUSHclient world function: world.GetSoundStatus


Name GetSoundStatus
Type Method
Summary Gets the status of a sound started by PlaySound
Prototype long GetSoundStatus(short Buffer);
Description

Gets the status of one of the sound buffers.

If you started playing a sound with StartSound this will tell you if it is still playing, and if so, whether it is set to loop or not.

Basically if the returned number is > 0 then the sound is playing, and if it is <= 0 then it is not playing.

You might test this in a timer to see if a sound had stopped playing (eg. some music), and if so, play something else.

Buffer: Which buffer to query (1 to 10).


Note: Available in version 4.28 onwards.


VBscript example
result = GetSoundStatus (1)  ' find what sound buffer 1 is doing
Lua example
result = GetSoundStatus (1)
Returns -3: Sound system is not initialized (ie. DirectX not installed or too early version)
-2: That buffer is free (never played a sound, or the sound was stopped with StopSound)
-1: Requested buffer number out of range 1 to 10
0: That buffer has reached the end and stopped playing
1: That buffer is playing a sound, but not looping
2: That buffer is playing a sound, which is a looping sound
Introduced in version 4.28

See also ...

Function Description
PlaySound Plays a sound using DirectSound
Sound Plays a sound
StopSound Stop playing a sound started by PlaySound

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.


Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes


Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes


View all functions

[Back]

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.