BASS.NET API for the Un4seen BASS Audio Library

BassMixBASS_Split_StreamGetAvailable Method

BASS.NET API for the Un4seen BASS Audio Library
Retrieves the amount of buffered data available to a splitter stream, or the amount of data in a splitter source buffer.

Namespace:  Un4seen.Bass.AddOn.Mix
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

[DllImportAttribute("bassmix")]
public static int BASS_Split_StreamGetAvailable(
	int handle
)

Parameters

handle
Type: SystemInt32
The splitter (as obtained by BASS_Split_StreamCreate(Int32, BASSFlag, Int32)) or the source channel handle.

Return Value

Type: Int32
If successful, then the amount of buffered data (in bytes) is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

With a splitter source, this function reports how much data is in the buffer that is shared by all of its splitter streams. With a splitter stream, this function reports how much data is ahead of it in the buffer, before it will receive any new data from the source. A splitter stream can be repositioned within the buffer via the BASS_Split_StreamResetEx(Int32, Int32) function.

The amount of data that can be buffered is limited by the buffer size, which is determined by the BASS_CONFIG_SPLIT_BUFFER config option.

The returned buffered byte count is always based on the source's sample format, even with splitter streams that were created with a different channel count.

ERROR CODEDescription
BASS_ERROR_HANDLEThe handle is neither a splitter stream or source.

Examples

Create two 1:1 clones:
// create a new splitter
int newsplit = BassMix.BASS_Split_StreamCreate(source, ...);
// get the amount of data an existing splitter has buffered
int offset = BassMix.BASS_Split_StreamGetAvailable(oldsplit);
// add the amount in its playback buffer
offset += BASS_ChannelGetData(oldsplit, null, BASSData.BASS_DATA_AVAILABLE);
// reset the new splitter to that far back in the source buffer
BassMix.BASS_Split_StreamResetEx(newsplit, offset);
// start playing it
Bass.BASS_ChannelPlay(newsplit, false);
See Also

Reference