BASS_ATTRIB_SPLIT_ASYNCBUFFER attribute


Amount of data to asynchronously buffer from a splitter's source.

BASS_ChannelSetAttribute(
    HSTREAM handle,
    BASS_ATTRIB_SPLIT_ASYNCBUFFER,
    float buffer
);

Parameters

handleThe splitter stream handle.
bufferThe amount to buffer, in seconds... 0 = disable asynchronous buffering. The asynchronous buffering will be limited to the splitter's buffer length, as determined by BASS_CONFIG_SPLIT_BUFFER.

Remarks

A splitter stream will usually get data from its source only when it is needed. This attribute allows the data to be gotten ahead of time asynchronously instead, so that it is ready for the splitter to access immediately when needed. This is not really useful with normal BASS playback (which is already buffered) but it can be used to implement buffering in other cases, eg. for mixer sources. The setting applies to all splitter streams that have the same source

When there are multiple splitters with the same source, the asynchronous buffering is based on the most advanced of them, which means that the asynchronous buffer length should be under the splitter buffer length (BASS_CONFIG_SPLIT_BUFFER) to allow the splitter positions to get apart from each other without the buffer overflowing for any of them. That margin should be at least equal to the maximum amount that you expect the splitter positions to get apart at any time.

By default, the asynchronous buffering will try to fill any space in the buffer in one data request of the source. It can be broken down into smaller amounts via the BASS_ATTRIB_SPLIT_ASYNCPERIOD attribute.

If a splitter stream needs more data than has been buffered then it will revert to synchronously getting data from the source for the remainder, unless it has the BASS_SPLIT_SLAVE flag set.

The amount of data that a splitter has buffered can be retrieved from BASS_Split_StreamGetAvailable.

The default setting is 0 (no asynchronous buffering). Changes take immediate effect.

See also

BASS_Split_StreamCreate, BASS_Split_StreamGetAvailable, BASS_ATTRIB_SPLIT_ASYNCPERIOD

BASS_ChannelGetAttribute, BASS_ChannelSetAttribute