BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_SampleGetChannels Method (Int32)BASS.NET API for the Un4seen BASS Audio Library
Retrieves all a sample's existing channels.

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

public static int[] BASS_SampleGetChannels(
	int handle


Type: SystemInt32
Handle of the sample.

Return Value

Type: Int32
If successful, the array of existing channels is returned (which might have zero elements), else is returned. Use BASS_ErrorGetCode to get the error code.

This overload only returns the existing channels in the array.

If you need to determine whether a particular sample channel still exists, it is simplest to just try it in a function call, eg. BASS_ChannelGetAttribute(Int32, BASSAttribute, Single).

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not a valid sample handle.


Set the sample rate of all a sample's channels to 10000hz:
Dim chans As Integer() = Bass.BASS_SampleGetChannels(handle)
If Not (chans Is Nothing) Then
  ' go through them all and...
  Dim a As Integer
  For a = 0 To chans.Length - 1
    ' set the sample rate to 10000
    Bass.BASS_ChannelSetAttribute(chans(a), BASSAttribute.BASS_ATTRIB_FREQ, 10000F)
  Next a
End If
int[] chans = Bass.BASS_SampleGetChannels(handle);
if (chans != null)
  // go through them all and...
  for (int a=0; a<chans.Length; a++)
    // set the sample rate to 10000
    Bass.BASS_ChannelSetAttribute(chans[a], BASSAttribute.BASS_ATTRIB_FREQ, 10000f);
See Also