oa::audio::Audio

Whole-audio value backed by a planar FP32 [channels, samples] matrix. Clones retain the same matrix storage and semantic audio metadata.

StRust public API

Declaration

pub struct Audio { /* private fields */ }
Public Rust declaration.

Public Methods

pub const fn as_matrix(&self) -> &Matrix
pub fn channels(&self) -> usize
pub fn samples(&self) -> usize
pub const fn sample_rate(&self) -> u32
pub const fn layout(&self) -> AudioChannelLayout
pub fn duration_seconds(&self) -> f64
pub fn gain(&self, gain_db: f32) -> Result<Self>
pub fn normalize(&self, config: NormalizeAudioConfig) -> Result<Self>
pub fn resample(&self, config: ResampleConfig) -> Result<Self>
pub fn to_mono(&self) -> Result<Self>
pub fn clip(&self, minimum: f32, maximum: f32) -> Result<Self>
pub fn pre_emphasis(&self, alpha: f32) -> Result<Self>
pub fn saturate(&self, drive_db: f32, mix: f32) -> Result<Self>
pub fn biquad(&self, coefficients: BiquadCoefficients) -> Result<Self>
pub fn sos_filter(&self, sections: &[BiquadCoefficients]) -> Result<Self>
pub fn reverb(&self, decay_seconds: f32, wet: f32) -> Result<Self>
pub fn fade(&self, fade_in_samples: u64, fade_out_samples: u64) -> Result<Self>
fn clone(&self) -> Audio

Associated Functions

pub fn new( data: Matrix, sample_rate: u32, layout: AudioChannelLayout, ) -> Result<Self>
pub fn from_planar_f32( engine: &Engine, samples: &[f32], channel_count: usize, sample_rate: u32, layout: AudioChannelLayout, ) -> Result<Self>

Public Method Documentation

pub const fn as_matrix( &self ) -> &Matrix
No public source comment is attached to this declaration.
pub fn channels( &self ) -> usize
No public source comment is attached to this declaration.
pub fn samples( &self ) -> usize
No public source comment is attached to this declaration.
pub const fn sample_rate( &self ) -> u32
No public source comment is attached to this declaration.
pub const fn layout( &self ) -> AudioChannelLayout
No public source comment is attached to this declaration.
pub fn duration_seconds( &self ) -> f64
No public source comment is attached to this declaration.
pub fn gain( &self, gain_db: f32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn normalize( &self, config: NormalizeAudioConfig ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn resample( &self, config: ResampleConfig ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn to_mono( &self ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn clip( &self, minimum: f32, maximum: f32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn pre_emphasis( &self, alpha: f32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn saturate( &self, drive_db: f32, mix: f32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn biquad( &self, coefficients: BiquadCoefficients ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn sos_filter( &self, sections: &[BiquadCoefficients] ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn reverb( &self, decay_seconds: f32, wet: f32 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn fade( &self, fade_in_samples: u64, fade_out_samples: u64 ) -> Result<Self>
No public source comment is attached to this declaration.
fn clone( &self ) -> Audio
No public source comment is attached to this declaration.
pub fn new( data: Matrix, sample_rate: u32, layout: AudioChannelLayout ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn from_planar_f32( engine: &Engine, samples: &[f32], channel_count: usize, sample_rate: u32, layout: AudioChannelLayout ) -> Result<Self>
No public source comment is attached to this declaration.