BASS_SamplePlay

Plays a sample, using the sample's default attributes.

HCHANNEL WINAPI BASS_SamplePlay(
    HSAMPLE handle
);

Parameters
handleHandle of the sample to play.

Return value
If successful, the handle of the channel used to play the sample is returned, else NULL is returned. Use BASS_ErrorGetCode to get the error code.

Error codes
BASS_ERROR_STARTThe digital output has not been started. Use BASS_Start to do so.
BASS_ERROR_HANDLEhandle is not a valid sample handle.
BASS_ERROR_NO3DThe sample has 3D functionality... BASS_SamplePlay3D should be used to play it.
BASS_ERROR_NOCHANThe sample has no free channel on which to be played... the maximum number of simultaneous playbacks has been reached, and no BASS_SAMPLE_OVER flag was specfied for the sample.
BASS_ERROR_NOHWNo hardware voices are available... this only occurs if the sample was loaded or 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.
BASS_ERROR_BUFLOSTShould not happen, but... PLEASE REPORT IT IF YOU DO GET THIS ERROR!

Remarks
Use BASS_SampleGetInfo and BASS_SampleSetInfo to set a sample's default attributes.

See also
BASS_ChannelGetPosition, BASS_ChannelIsActive, BASS_ChannelPause, BASS_ChannelStop, BASS_SampleCreate, BASS_SampleLoad, BASS_SamplePlayEx, BASS_SampleStop