BASS.NET API for the Un4seen BASS Audio Library

UtilsSampleTo24Bit Method (Single)

BASS.NET API for the Un4seen BASS Audio Library
Converts a float 32-bit signed sample to a 24-bit signed sample.

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

public static byte[] SampleTo24Bit(
	float sample
)

Parameters

sample
Type: SystemSingle
The 32-bit signed sample to convert.

Return Value

Type: Byte
A byte array representing the converted 24-bit signed sample (byte[3]).
Remarks

The byte order is represented in the "Little Endian" format as saved on Intel platforms (meaning lower byte first, the LSB is stored at index 0). If you need a "Big Endian" format just traverse the array from the back.

Note: values greater 1.0 or less than -1.0 are capped.

See Also

Reference