MusHandleUnPause()

Syntax

int MusHandleUnPause(musHandle handle);

Arguments

handle
the sound handle

Description

It resumes the processing of the channels associated with the specified sound handle, if it has been paused. The channels will resume processing on the next player update and have their current volume level set to the value they were at before processing was paused (when switched to the thread for music player).

The pausing/resuming process may result in songs not quite sounding exactly as they should. This is because processing is suspended but the samples currently being used will play through to the end or loop. When processing is resumed, some samples may be offset because the sample playing continues during the pause period.

This function passes the pause command to the player via the FIFO buffer. If there is no space free in the FIFO buffer, this command will be ignored. The FIFO buffer is emptied every time the player processes sound data.

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.

Return Value

Zero (0) if the FIFO command has been ignored, otherwise a non-zero value.

Example

void ResumeSong(musHandle handle)
{
  int i;

  while (MusHandleUnPause(handle)==0)
    WaitForVsync();
  for (i=0; i!=0x80; i+=0x20)
  {
    WaitForVsync();
    MusHandleSetVolume(handle, i);
  }
}

See Also

MusHandlePause(), MusStartSong(), MusStartEffect(), MusStartEffect2()