BASS.NET API for the Un4seen BASS Audio Library

ENCODERPROC Delegate

BASS.NET API for the Un4seen BASS Audio Library
User defined callback function to encode sample data.

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

public delegate int ENCODERPROC(
	int handle,
	int channel,
	IntPtr buffer,
	int length,
	int maxout,
	IntPtr user
)

Parameters

handle
Type: SystemInt32
The encoder handle.
channel
Type: SystemInt32
The channel that the encoder is set on.
buffer
Type: SystemIntPtr
Buffer containing the sample data on input, and containing the encoded data on output.
length
Type: SystemInt32
The number of bytes in the buffer... -1 = the encoder is being freed (no data in the buffer).
maxout
Type: SystemInt32
The maximum amount of encoded data that can be placed in the buffer.
user
Type: SystemIntPtr
The user instance data given when BASS_Encode_StartUser(Int32, String, BASSEncode, ENCODERPROC, IntPtr) was called.

Return Value

Type: Int32
The number of bytes of encoded data placed in buffer... -1 = stop encoding.
Remarks

If the encoder output exceeds the outmax value, then only the first outmax bytes should be delivered and the remainder retained. The function will be called again immediately to get the remainder.

Instead of returning the data in buffer, it is also possible to provide the encoded data via BASS_Encode_UserOutput(Int32, Int64, IntPtr, Int32), which also adds the ability to update previous data (eg. headers).

See Also

Reference