BASS_Split_StreamResetEx

Resets a splitter stream and sets its position in the source buffer.

BOOL BASS_Split_StreamResetEx(
    DWORD handle,
    DWORD offset
);

Parameters

handleThe splitter handle.
offsetHow far back (in bytes) to position the splitter in the source buffer. This is based on the source's sample format, which may have a different channel count to the splitter.

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 splitter stream.

Remarks

This function is the same as BASS_Split_StreamReset except that it also provides the ability to position the splitter stream within the buffer that is shared by all of the splitter streams of the same source. A splitter stream's buffer position determines what data it will next receive. For example, if its position is half a second back, it will receive half a second of buffered data before receiving new data from the source. Calling this function with offset = 0 will result in the next data that the splitter stream receives being new data from the source, and is identical to using BASS_Split_StreamReset.

offset is automatically limited to the amount of data that the source buffer contains, which is in turn limited to the buffer size, determined by the BASS_CONFIG_SPLIT_BUFFER config option. The amount of source data buffered, as well as a splitter stream's position within it, is available from BASS_Split_StreamGetAvailable.

Example

Create a new splitter stream that will first play 0.5s of already buffered data (if available).
split = BASS_Split_StreamCreate(source, 0, NULL); // create a splitter stream
BASS_Split_StreamResetEx(split, BASS_ChannelSeconds2Bytes(source, 0.5)); // set it 0.5s back in the buffer
BASS_ChannelPlay(split, FALSE); // start playing

See also

BASS_Split_StreamGetAvailable, BASS_Split_StreamReset, BASS_CONFIG_SPLIT_BUFFER