pub struct AudioAnalysisInput {
input: AudioInput,
fft: Arc<dyn Fft<f32>>,
fft_size: usize,
}Expand description
Audio input with FFT analysis for bass/mid/treb extraction.
Fields§
§input: AudioInputAudio input
fft: Arc<dyn Fft<f32>>FFT planner
fft_size: usizeFFT buffer size
Implementations§
Source§impl AudioAnalysisInput
impl AudioAnalysisInput
Sourcepub fn new(fft_size: usize) -> Result<Self>
pub fn new(fft_size: usize) -> Result<Self>
Create a new audio analysis input.
§Arguments
fft_size- Size of FFT window (power of 2, e.g., 2048)
Sourcepub fn analyze(&self) -> (f32, f32, f32)
pub fn analyze(&self) -> (f32, f32, f32)
Analyze audio and extract bass, mid, treb levels. Returns (bass, mid, treb) in range [0.0, 1.0].
Sourcepub fn sample_rate(&self) -> u32
pub fn sample_rate(&self) -> u32
Get the sample rate.
Sourcepub fn get_samples(&self) -> Vec<f32>
pub fn get_samples(&self) -> Vec<f32>
Get raw samples for further processing.
Auto Trait Implementations§
impl Freeze for AudioAnalysisInput
impl !RefUnwindSafe for AudioAnalysisInput
impl Send for AudioAnalysisInput
impl Sync for AudioAnalysisInput
impl Unpin for AudioAnalysisInput
impl !UnwindSafe for AudioAnalysisInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more