world.StopSound

MUSHclient script function (Method) — introduced in version 4.28

Stop playing a sound started by PlaySound

Prototype

long StopSound(short Buffer);

Data type meanings

Description

Stops one, or all, sound buffers from playing.

It is not necessary to call this for non-looping sounds, which stop of their own accord anyway, however doing so would free up the memory used by the sound.

The buffer argument specifies which buffer to stop (1 to 10) or 0 to stop all sound buffers playing.

VBscript example

StopSound 0  ' Stop playing all sounds
StopSound 1 ' Stop playing sound buffer #1

Lua example

StopSound (0)  -- Stop playing all sounds
StopSound (1)  -- Stop playing sound buffer #1

Lua notes

The buffer number is optional and defaults to zero, which will stop all sounds from playing.

Return value

eBadParameter: Buffer number outside range 0 to 10
eOK: Requested buffer(s) have been stopped.

Return code meanings

Related topic

Utilities

See also

FunctionDescription
GetSoundStatusGets the status of a sound started by PlaySound
PlaySoundPlays a sound using DirectSound
SoundPlays a sound