Trait 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

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§