BASS.NET API for the Un4seen BASS Audio Library

BassEncBASS_Encode_GetCount Method

BASS.NET API for the Un4seen BASS Audio Library
Retrieves the amount of data queued, sent to or received from an encoder, or sent to a cast server.

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

[DllImportAttribute("bassenc")]
public static long BASS_Encode_GetCount(
	int handle,
	BASSEncodeCount count
)

Parameters

handle
Type: SystemInt32
The encoder handle.
count
Type: Un4seen.Bass.AddOn.EncBASSEncodeCount
The count to retrieve. One of the following (see BASSEncodeCount):
BASS_ENCODE_COUNT_INData sent to the encoder.
BASS_ENCODE_COUNT_IN_FPData sent to the encoder before any floating-point conversion.
BASS_ENCODE_COUNT_OUTData received from the encoder. This only applies when the encoder outputs to STDOUT or it is an ACM encoder.
BASS_ENCODE_COUNT_CASTData sent to a cast server.
BASS_ENCODE_COUNT_QUEUEData currently in the queue, waiting to be sent to the encoder, if async encoding is enabled (i.e. the BASS_ENCODE_QUEUE flag was used with BASS_Encode_Start(Int32, String, BASSEncode, ENCODEPROC, IntPtr)).
BASS_ENCODE_COUNT_QUEUE_LIMITThe queue's size limit.
BASS_ENCODE_COUNT_QUEUE_FAILData not queued due to the queue being full or out of memory.

Return Value

Type: Int64
If successful, the requested count (in bytes) is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

The BASS_ENCODE_COUNT_IN_FP and queue counts are based on the channel's sample format (floating-point if the BASS_CONFIG_FLOATDSP option is enabled), while the BASS_ENCODE_COUNT_IN count is based on the sample format used by the encoder, which could be different if one of the BASS_ENCODE_FP flags is active or the encoder is using an ACM codec (which take 16-bit data).

When the encoder output is being sent to a cast server, the BASS_ENCODE_COUNT_CAST count will match the BASS_ENCODE_COUNT_OUT count, unless there have been problems (eg. network timeout) that have caused data to be dropped.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_NOTAVAILThe encoder does not have a queue.
BASS_ERROR_ILLPARAMcount is not valid.

See Also

Reference