BASS

BASS_ChannelPlay


Starts (or resumes) playback of a sample, stream, MOD music, or recording.

BOOL BASS_ChannelPlay(
    DWORD handle,
    BOOL restart
);

Parameters

handleThe channel handle... a HCHANNEL, HMUSIC, HSTREAM, or HRECORD.
restartRestart playback from the beginning? If handle is a user stream (created with BASS_StreamCreate), its current buffer contents are cleared. If it is a MOD music, its BPM/etc are reset to their initial values.

Return value

If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not a valid channel.
BASS_ERROR_STARTThe output is paused/stopped, use BASS_Start to start it.
BASS_ERROR_DECODEThe channel is not playable; it is a "decoding channel".
BASS_ERROR_BUFLOSTShould not happen... check that a valid window handle was used with BASS_Init.
BASS_ERROR_NOHWNo hardware voices are available (HCHANNEL only). This only occurs if the sample was loaded/created with the BASS_SAMPLE_VAM flag and BASS_VAM_HARDWARE is set in the sample's VAM mode, and there are no hardware voices available to play it.

Remarks

When streaming in blocks (BASS_STREAM_BLOCK), the restart parameter is ignored as it is not possible to go back to the start. The restart parameter is also of no consequence with recording channels.

See also

BASS_ChannelFlags, BASS_ChannelGetLevel, BASS_ChannelGetPosition, BASS_ChannelIsActive, BASS_ChannelPause, BASS_ChannelSetPosition, BASS_ChannelSetSync, BASS_ChannelStop, BASS_ChannelUpdate