BASS.NET API for the Un4seen BASS Audio LibraryENCODERPROC DelegateBASS.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:

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


Type: SystemInt32
The encoder handle.
Type: SystemInt32
The channel that the encoder is set on.
Type: SystemIntPtr
Buffer containing the sample data on input, and containing the encoded data on output.
Type: SystemInt32
The number of bytes in the buffer... -1 = the encoder is being freed (no data in the buffer).
Type: SystemInt32
The maximum amount of encoded data that can be placed in the buffer.
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.

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