Skip to main content

Sample

Trait Sample 

Source
pub trait Sample: Sealed + Copy {
    // Required method
    fn to_f32(self) -> f32;
}
Expand description

A PCM sample type the analyzer accepts: i16 or f32.

f32 samples are full scale at ±1.0 and i16 samples at ±32768. The trait is sealed so other integer widths can be added later with their own scale.

Required Methods§

Source

fn to_f32(self) -> f32

The sample as a full-scale f32 value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Sample for f32

Source§

fn to_f32(self) -> f32

Source§

impl Sample for i16

Source§

fn to_f32(self) -> f32

Implementors§