[−][src]Trait cpal::Sample
Trait for containers that contain PCM data.
Associated Constants
const FORMAT: SampleFormat
The SampleFormat
corresponding to this data type.
Required methods
fn to_f32(&self) -> f32
Turns the sample into its equivalent as a floating-point.
fn to_i16(&self) -> i16
Converts this sample into a standard i16 sample.
fn to_u16(&self) -> u16
Converts this sample into a standard u16 sample.
fn from<S>(_: &S) -> Self where
S: Sample,
S: 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]
const FORMAT: SampleFormat
[src]
fn to_f32(&self) -> f32
[src]
fn to_i16(&self) -> i16
[src]
fn to_u16(&self) -> u16
[src]
fn from<S>(sample: &S) -> Self where
S: Sample,
[src]
S: Sample,
impl Sample for i16
[src]
const FORMAT: SampleFormat
[src]
fn to_f32(&self) -> f32
[src]
fn to_i16(&self) -> i16
[src]
fn to_u16(&self) -> u16
[src]
fn from<S>(sample: &S) -> Self where
S: Sample,
[src]
S: Sample,
impl Sample for f32
[src]
const FORMAT: SampleFormat
[src]
fn to_f32(&self) -> f32
[src]
fn to_i16(&self) -> i16
[src]
fn to_u16(&self) -> u16
[src]
fn from<S>(sample: &S) -> Self where
S: Sample,
[src]
S: Sample,