Crate sample [] [src]

A crate of fundamentals for audio PCM DSP.

  • Use the Sample trait to remain generic across bit-depth.
  • Use the Frame trait to remain generic over channel layout.
  • Use the Signal trait for working with Iterators that yield Frames.
  • Use the slice module for working with slices of Samples and Frames.
  • See the conv module for fast conversions between slices, frames and samples.
  • See the types module for provided custom sample types.
  • See the interpolate module for sample rate conversion and scaling.


pub use conv::FromSample;
pub use conv::ToSample;
pub use conv::Duplex;
pub use conv::FromSampleSlice;
pub use conv::ToSampleSlice;
pub use conv::DuplexSampleSlice;
pub use conv::FromSampleSliceMut;
pub use conv::ToSampleSliceMut;
pub use conv::DuplexSampleSliceMut;
pub use conv::FromBoxedSampleSlice;
pub use conv::ToBoxedSampleSlice;
pub use conv::DuplexBoxedSampleSlice;
pub use conv::FromFrameSlice;
pub use conv::ToFrameSlice;
pub use conv::DuplexFrameSlice;
pub use conv::FromFrameSliceMut;
pub use conv::ToFrameSliceMut;
pub use conv::DuplexFrameSliceMut;
pub use conv::FromBoxedFrameSlice;
pub use conv::ToBoxedFrameSlice;
pub use conv::DuplexBoxedFrameSlice;
pub use conv::DuplexSlice;
pub use conv::DuplexSliceMut;
pub use conv::DuplexBoxedSlice;
pub use frame::Frame;
pub use signal::Signal;
pub use types::I24;
pub use types::U24;
pub use types::I48;
pub use types::U48;



Pure functions and traits for converting between i8, i16, I24, i32, I48, i64, u8, u16, U24, u32, U48, u64, f32 and f64.


Use the Frame trait to remain generic over the number of channels at a single discrete moment in time.


The Interpolate module allows for conversion between various sample rates.


Use the Signal trait for working with Iterators that yield Frames. To complement the Iterator trait, Signal provides methods for adding, scaling, offsetting, multiplying, clipping and generating frame iterators and more.


This module provides various helper functions for performing operations on slices of frames.


A collection of custom, non-std Sample types.


Module for windowing over a batch of Frames. Includes default Hanning and Rectangle window types.



Sample format types represented as floating point numbers.


A trait for working generically across different Sample format types.


Integral and floating-point Sample format types whose equilibrium is at 0.

Type Definitions