pub struct Pitch { /* private fields */ }
Expand description
Pitch detection object
Implementations§
Source§impl Pitch
impl Pitch
Sourcepub fn new(
method: PitchMode,
buf_size: usize,
hop_size: usize,
sample_rate: u32,
) -> Result<Self>
pub fn new( method: PitchMode, buf_size: usize, hop_size: usize, sample_rate: u32, ) -> Result<Self>
Creation of the pitch detection object
method
Pitch detection algorithmbuf_size
Size of the input buffer to analysehop_size
Step size between two consecutive analysis instantsample_rate
Sampling rate of the signal
Sourcepub fn with_tolerance(self, tolerance: Smpl) -> Self
pub fn with_tolerance(self, tolerance: Smpl) -> Self
Change yin or yinfft tolerance threshold
Sourcepub fn with_silence(self, silence: Smpl) -> Self
pub fn with_silence(self, silence: Smpl) -> Self
Set the silence threshold of the pitch detection object
Sourcepub fn with_unit(self, unit: PitchUnit) -> Self
pub fn with_unit(self, unit: PitchUnit) -> Self
Set the output unit of the pitch detection object
Sourcepub fn do_<'i, 'o, I, O>(&mut self, input: I, output: O) -> Status
pub fn do_<'i, 'o, I, O>(&mut self, input: I, output: O) -> Status
Execute pitch detection on an input signal frame
input
Input signal of sizehop_size
output
Output pitch candidates of size 1
Sourcepub fn do_result<'i, I>(&mut self, input: I) -> Result<Smpl>
pub fn do_result<'i, I>(&mut self, input: I) -> Result<Smpl>
Execute pitch detection on an input signal frame
input
Input signal of sizehop_size
Sourcepub fn set_tolerance(&mut self, tolerance: Smpl)
pub fn set_tolerance(&mut self, tolerance: Smpl)
Change yin or yinfft tolerance threshold
Sourcepub fn get_tolerance(&self) -> Smpl
pub fn get_tolerance(&self) -> Smpl
Get yin or yinfft tolerance threshold
Sourcepub fn set_silence(&mut self, silence: Smpl)
pub fn set_silence(&mut self, silence: Smpl)
Set the silence threshold of the pitch detection object
Sourcepub fn get_silence(&self) -> Smpl
pub fn get_silence(&self) -> Smpl
Get the silence threshold of the pitch detection object
Sourcepub fn get_confidence(&self) -> Smpl
pub fn get_confidence(&self) -> Smpl
Get the current confidence of the pitch algorithm
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pitch
impl RefUnwindSafe for Pitch
impl !Send for Pitch
impl !Sync for Pitch
impl Unpin for Pitch
impl UnwindSafe for Pitch
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