[][src]Module bae_rs::sample_format

Sample Format

Module containing different output formats like stereo, 2.1, 5.1, 7.1, etc.

All functions that deal with converting raw bytes to numeric types assume the bytes are in little-endian format.

As there is no i24 built-in type, i32 is used in it's place where applicable. In most cases where a 24-bit sample is stored in a 32-bit data type, the upper byte is ignored or explicitly set to 0.

Re-exports

pub use mono::*;
pub use stereo::*;

Modules

mono

Mono

stereo

Stereo

Traits

Panner

Trait implementing the ability to pan a monophonic sample into a polyphonic sample. This is generic for the polyphonic type and the type that defines how it is panned. To see an implementation, see Stereo::to_sample_format.

SampleFormat

Trait implementing the ability to perform math operations with a polyphonic sample format and a monophonic sample.

Functions

sample_from_i16

Converts an i16 16-bit sample to a SampleT.

sample_from_i16_bytes

Converts raw bytes to a SampleT.

sample_from_i24

Converts an i32 24-bit sample to a SampleT.

sample_from_i24_bytes

Converts raw bytes to a SampleT.

sample_from_u8

Converts a u8 8-bit sample to a SampleT.

sample_from_u8_bytes

Converts a raw byte to a SampleT.

sample_to_i16

Converts a SampleT to an i16.

sample_to_i16_bytes

Converts a SampleT to raw little-endian bytes.

sample_to_i24

Converts a SampleT to an i24.

sample_to_i24_bytes

Converts a SampleT to raw little-endian bytes.

sample_to_u8

Converts a SampleT to an u8.

sample_to_u8_bytes

Converts a SampleT to a raw little-endian byte.