BASS.NET API for the Un4seen BASS Audio Library

BassBASS_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.17.5
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:
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