Trait aym::AySample

source ·
pub trait AySample: Num + Copy {
    // Required methods
    fn to_i8(self) -> i8;
    fn to_i16(self) -> i16;
    fn to_i32(self) -> i32;
    fn to_f32(self) -> f32;
    fn to_f64(self) -> f64;
}
Expand description

Samples, returned by aym implement this trait; It allows to correctly convert the sound sample between different types. e.g. to_f32/to_f64 will always return sample in the correct range [-1.0; 1.0], while for example to_i8 will return the sound sample in range [-128; 127]

Required Methods§

source

fn to_i8(self) -> i8

source

fn to_i16(self) -> i16

source

fn to_i32(self) -> i32

source

fn to_f32(self) -> f32

source

fn to_f64(self) -> f64

Implementations on Foreign Types§

source§

impl AySample for f64

source§

fn to_i8(self) -> i8

source§

fn to_i16(self) -> i16

source§

fn to_i32(self) -> i32

source§

fn to_f32(self) -> f32

source§

fn to_f64(self) -> f64

Implementors§