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: 2.4.12.0
Syntax

public static int[] BASS_SampleGetChannels(
	int handle
)

Parameters

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.
Remarks

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.

Examples

Set the sample rate of all a sample's channels to 10000hz:
VB
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

Reference