Expand description
Type conversion of samples values.
Structs§
- Conversion
Result - A conversion result, containing the resulting value as
valueand a booleanclippedindicating if the value was clipped during conversion. - F32BE
- 32 bit floating point, big endian. Stored as 4 bytes.
- F32LE
- 32 bit floating point, little endian. Stored as 4 bytes.
- F64BE
- 64 bit floating point, big endian. Stored as 8 bytes.
- F64LE
- 64 bit floating point, little endian. Stored as 8 bytes.
- I16BE
- 16 bit signed integer, big endian. Stored as 2 bytes.
- I16LE
- 16 bit signed integer, little endian. Stored as 2 bytes.
- I24BE
- 24 bit signed integer, big endian. 24 bits stored packed as as 3 bytes or padded as 4 bytes.
- I24LE
- 24 bit signed integer, little endian. 24 bits stored packed as as 3 bytes or padded as 4 bytes.
- I32BE
- 32 bit signed integer, big endian. Stored as 4 bytes.
- I32LE
- 32 bit signed integer, little endian. Stored as 4 bytes.
- I64BE
- 64 bit signed integer, big endian. Stored as 8 bytes.
- I64LE
- 64 bit signed integer, little endian. Stored as 8 bytes.
- U16BE
- 16 bit unsigned integer, big endian. Stored as 2 bytes.
- U16LE
- 16 bit unsigned integer, little endian. Stored as 2 bytes.
- U24BE
- 24 bit unsigned integer, big endian. 24 bits stored packed as as 3 bytes or padded as 4 bytes.
- U24LE
- 24 bit unsigned integer, little endian. 24 bits stored packed as as 3 bytes or padded as 4 bytes.
- U32BE
- 32 bit unsigned integer, big endian. Stored as 4 bytes.
- U32LE
- 32 bit unsigned integer, little endian. Stored as 4 bytes.
- U64BE
- 64 bit unsigned integer, big endian. Stored as 8 bytes.
- U64LE
- 64 bit unsigned integer, little endian. Stored as 8 bytes.
Traits§
- Bytes
Sample - A trait for converting samples stored as raw bytes into a numerical type.
Each implementation defines the associated type
NumericType, which is the nearest matching numeric type for the original format. If a direct match exists, this is used. For example signed 16 bit integer samples use i16. For formats that don’t have a direct match, the next larger numeric type is used. For example for 24 bit signed integers, this means i32. The values are scaled to use the full range of theNumericTypeassociated type. - RawSample
- A trait for converting a given sample type to and from floating point values. The floating point values use the range -1.0 to +1.0. When converting to/from signed integers, the range does not include +1.0. For example, an 8-bit signed integer supports the range -128 to +127. When these values are converted to float, 0 becomes 0.0, -128 becomes -1.0, and 127 becomes 127/128 ≈ 0.992. Unsigned integers are also converted to the same -1.0 to +1.0 range. For an 8-but unsigned integer, 128 is the center point and becomes 0.0. The value 0 becomes -1.0, and 255 becomes 127/128 ≈ 0.992.