Trait cpal::Sample [] [src]

pub unsafe trait Sample: Copy + Clone {
    fn get_format() -> SampleFormat;
fn to_f32(&self) -> f32;
fn to_i16(&self) -> i16;
fn to_u16(&self) -> u16;
fn from<S>(_: &S) -> Self
    where
        S: Sample
; }

Trait for containers that contain PCM data.

Required Methods

Returns the SampleFormat corresponding to this data type.

Turns the sample into its equivalent as a floating-point.

Converts this sample into a standard i16 sample.

Converts this sample into a standard u16 sample.

Converts any sample type to this one by calling to_i16, to_u16 or to_f32.

Implementations on Foreign Types

impl Sample for u16
[src]

[src]

[src]

[src]

[src]

[src]

impl Sample for i16
[src]

[src]

[src]

[src]

[src]

[src]

impl Sample for f32
[src]

[src]

[src]

[src]

[src]

[src]

Implementors