MusHandleStop()

Syntax

int MusHandleStop(musHandle handle, int speed);

Arguments

handle
the sound handle
speed
the number of video frames before channels are silenced

Description

It stops and silences the channels associated with the specified sound handle in a specified amount of time. This function allows the programmer to stop songs and sound effects, which frees the channels associated with them.

The handle must be a sound handle returned by MusStartSong(), MusStartSongFromMarker(), MusStartEffect(), or MusStartEffect2(). If a handle of zero is supplied, this function will always return zero.

The speed value is the number of video frames before the channel will be stopped. Any positive integer is valid. A value of zero will stop the sound handle's channels immediately.

Return Value

Number of channels set to stop.

Example

void StopSpecificSound(unsigned long handle, int time);
{
  MusHandleStop(handle, time);
  while (MusHandleAsk(handle))
    CallNormalProcessing();
}

See Also

MusStartSong(), MusStartEffect(), MusStartEffect2()