BASS.NET API for the Un4seen BASS Audio LibraryBassWmaBASS_WMA_EncodeWrite Method (Int32, Int32, Int32)BASS.NET API for the Un4seen BASS Audio Library
Encodes sample data, and writes it to the file or network.

This overload uses a managed int[] to handover sample data to the encoder (Note: An int[] is 32-bit. When using 16-bit samples we can keep a stereo pair in here).

Namespace: Un4seen.Bass.AddOn.Wma
Assembly: Bass.Net (in Bass.Net.dll) Version:

public static bool BASS_WMA_EncodeWrite(
	int handle,
	int[] buffer,
	int length


Type: SystemInt32
The encoder handle.
Type: SystemInt32
The buffer containing the sample data.
Type: SystemInt32
The number of BYTES in the buffer.

Return Value

Type: Boolean
If succesful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.

The WMA codec expects 16-bit or 24-bit sample data depending on the BASS_WMA_ENCODE_24BIT flag, but BASSWMA will accept 8-bit, 16-bit or floating-point data, and convert it to the appropriate format.

There is generally no need to call this function if the BASS_WMA_ENCODE_SOURCE flag has been set on the encoder, as the encoder will automatically be fed the data that its source BASS channel produces.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_MEMThere is insufficient memory.
BASS_ERROR_UNKNOWNSome other mystery problem!


See the overload taking a byte array for an example.
See Also