Retrieves all a sample's existing channels.
Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
[DllImportAttribute("bass")] public static int BASS_SampleGetChannels( int handle, int[] channels )
Parameters
- handle
- Type: SystemInt32
Handle of the sample. - channels
- Type: SystemInt32
The array (int[])to put the sample's channel handles in. The array should be the same size as the sample's max setting when the sample was created, which can be retrieved using BASS_SampleGetInfo(Int32, BASS_SAMPLE). can be used to just check how many channels exist.
Return Value
Type: Int32If successful, the number of existing channels is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
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 CODE | Description |
---|---|
BASS_ERROR_HANDLE | handle is not a valid sample handle. |
Examples
// get sample info for "max" value BASS_SAMPLE info = Bass.BASS_SampleGetInfo(handle); // allocate channels array int[] chans = new int[info.max]; // get the channels int count = Bass.BASS_SampleGetChannels(handle, chans); // go through them all and... for (int a=0; a<count; a++) { // set the sample rate to 10000 Bass.BASS_ChannelSetAttribute(chans[a], BASSAttribute.BASS_ATTRIB_FREQ, 10000f); }
See Also