BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_SampleGetData Method (Int32, Byte)BASS.NET API for the Un4seen BASS Audio Library
Retrieves a copy of a sample's data.

This overload uses a managed byte[] to reference the buffer data as 8-bit! SHOULD ONLY BE USED, if the sample was created with or BASS_SAMPLE_8BITS!

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

[DllImportAttribute("bass.dll", CharSet = CharSet.Unicode)]
public static bool BASS_SampleGetData(
	int handle,
	byte[] buffer


Type: SystemInt32
The sample handle.
Type: SystemByte
The array array (byte[]) to receive the data, use or BASS_SAMPLE_8BITS when creating the sample!

Return Value

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

The buffer must be big enough to receive the sample's data, the size of which can be retrieved via BASS_SampleGetInfo(Int32, BASS_SAMPLE).

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


Dim info As BASS_SAMPLE = Bass.BASS_SampleGetInfo(sample)
Dim buffer(info.length - 1) As Byte
Bass.BASS_SampleGetData(sample, buffer)
BASS_SAMPLE info = Bass.BASS_SampleGetInfo(sample);
byte[] buffer = new byte[info.length];
Bass.BASS_SampleGetData(sample, buffer);
See Also