BASS.NET API for the Un4seen BASS Audio Library

BassAsioBASS_ASIO_ChannelSetRate Method

BASS.NET API for the Un4seen BASS Audio Library
Sets a channel's sample rate.

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

[DllImportAttribute("bassasio")]
public static bool BASS_ASIO_ChannelSetRate(
	bool input,
	int channel,
	double rate
)

Parameters

input
Type: SystemBoolean
Dealing with an input channel? = an output channel.
channel
Type: SystemInt32
The input/output channel number... 0 = first.
rate
Type: SystemDouble
The sample rate... 0 = device rate.

Return Value

Type: Boolean
If succesful, then is returned, else is returned. Use BASS_ASIO_ErrorGetCode to get the error code.
Remarks

For optimal quality and performance, it is best to set the device to the sample rate you want via BASS_ASIO_SetRate(Double), but that's not always possible. Which is where this function and resampling comes into play. 16 point sinc interpolation is used, giving a good blend of sound quality and performance. It is also SSE2 and 3DNow optimized for an extra boost with supporting CPUs.

When a channel's sample rate is the same as the device rate, resampling is bypassed, so there's no unnecessary performance hit.

Resampling is not supported when the sample format is DSD.

ERROR CODEDescription
BASS_ERROR_INITBASS_ASIO_Init(Int32, BASSASIOInit) has not been successfully called.
BASS_ERROR_ILLPARAMThe input and channel combination is invalid, or rate is below 0.
BASS_ERROR_FORMATFormat conversion is not available for the channel's native sample format (please report).

Examples

// set the device rate
BassAsio.BASS_ASIO_SetRate(44100);
// set the channel's rate
BassAsio.BASS_ASIO_ChannelSetRate(false, 0, 44100);
See Also

Reference