Namespace: Un4seen.BassAsio
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
[DllImportAttribute("bassasio")] public static bool BASS_ASIO_ChannelSetFormat( bool input, int channel, BASSASIOFormat format )
Parameters
- input
- Type: SystemBoolean
Dealing with an input channel? = an output channel. - channel
- Type: SystemInt32
The input/output channel number... 0 = first. - format
- Type: Un4seen.BassAsioBASSASIOFormat
The sample format. One of the following (see BASSASIOFormat):BASS_ASIO_FORMAT_16BIT 16-bit integer. BASS_ASIO_FORMAT_24BIT 24-bit integer. BASS_ASIO_FORMAT_32BIT 32-bit integer. BASS_ASIO_FORMAT_FLOAT 32-bit floating-point. BASS_ASIO_FORMAT_DSD_LSB DSD with LSB first. BASS_ASIO_FORMAT_DSD_MSB DSD with MSB first. BASS_ASIO_FORMAT_DITHER flag: apply dither (TDPF) to the output.
Return Value
Type: BooleanIf succesful, then is returned, else is returned. Use BASS_ASIO_ErrorGetCode to get the error code.
The sample format can vary between ASIO devices/drivers, which could mean a lot of extra/duplicate code being required. To avoid that extra work, BASSASIO can automatically convert the sample data, whenever necessary, to/from a format of your choice. The native format of a channel can be retrieved via BASS_ASIO_ChannelGetInfo(Boolean, Int32, BASS_ASIO_CHANNELINFO).
The PCM format options are only available when the device's format is PCM, and the DSD format options are only available when the device's format is DSD. If a device supports both, it can be switched between DSD and PCM via BASS_ASIO_SetDSD(Boolean).
For performance reasons, it's best not to use 24-bit sample data whenever possible, as 24-bit data requires a bit more processing than the other formats.
ERROR CODE | Description |
---|---|
BASS_ERROR_INIT | BASS_ASIO_Init(Int32, BASSASIOInit) has not been successfully called. |
BASS_ERROR_ILLPARAM | The input and channel combination is invalid, or format is. |
BASS_ERROR_FORMAT | Format conversion is not available for the channel's native sample format (please report). |