pub struct AudioAnalyzer { /* private fields */ }Expand description
Main audio analyzer that coordinates all frequency analysis operations.
Implementations§
Source§impl AudioAnalyzer
impl AudioAnalyzer
Sourcepub fn new(sample_rate: u32) -> Self
pub fn new(sample_rate: u32) -> Self
Create a new audio analyzer with the specified sample rate.
Sourcepub fn with_fft_params(
sample_rate: u32,
fft_size: usize,
hop_size: usize,
) -> Self
pub fn with_fft_params( sample_rate: u32, fft_size: usize, hop_size: usize, ) -> Self
Create an analyzer with custom FFT parameters.
Sourcepub async fn extract_audio(
&self,
video_path: impl AsRef<Path>,
) -> Result<AudioData>
pub async fn extract_audio( &self, video_path: impl AsRef<Path>, ) -> Result<AudioData>
Extract audio from a video file using FFmpeg.
Sourcepub fn analyze(&self, audio: &AudioData) -> Result<FrequencyAnalysis>
pub fn analyze(&self, audio: &AudioData) -> Result<FrequencyAnalysis>
Perform complete frequency analysis on audio data.
Sourcepub fn dominant_frequencies(
&self,
audio: &AudioData,
top_k: usize,
) -> Result<Vec<DominantFrequency>>
pub fn dominant_frequencies( &self, audio: &AudioData, top_k: usize, ) -> Result<Vec<DominantFrequency>>
Get the dominant frequencies from audio.
Sourcepub fn compute_signature(&self, audio: &AudioData) -> Result<FrequencySignature>
pub fn compute_signature(&self, audio: &AudioData) -> Result<FrequencySignature>
Compute frequency signature for similarity matching.
Auto Trait Implementations§
impl Freeze for AudioAnalyzer
impl RefUnwindSafe for AudioAnalyzer
impl Send for AudioAnalyzer
impl Sync for AudioAnalyzer
impl Unpin for AudioAnalyzer
impl UnsafeUnpin for AudioAnalyzer
impl UnwindSafe for AudioAnalyzer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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