Pitch

Struct Pitch 

Source
pub struct Pitch { /* private fields */ }
Expand description

Pitch detection object

Implementations§

Source§

impl Pitch

Source

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 algorithm
  • buf_size Size of the input buffer to analyse
  • hop_size Step size between two consecutive analysis instant
  • sample_rate Sampling rate of the signal
Source

pub fn with_tolerance(self, tolerance: Smpl) -> Self

Change yin or yinfft tolerance threshold

Source

pub fn with_silence(self, silence: Smpl) -> Self

Set the silence threshold of the pitch detection object

Source

pub fn with_unit(self, unit: PitchUnit) -> Self

Set the output unit of the pitch detection object

Source

pub fn get_hop(&self) -> usize

Get hop size

Source

pub fn do_<'i, 'o, I, O>(&mut self, input: I, output: O) -> Status
where I: Into<FVec<'i>>, O: Into<FVecMut<'o>>,

Execute pitch detection on an input signal frame

  • input Input signal of size hop_size
  • output Output pitch candidates of size 1
Source

pub fn do_result<'i, I>(&mut self, input: I) -> Result<Smpl>
where I: Into<FVec<'i>>,

Execute pitch detection on an input signal frame

  • input Input signal of size hop_size
Source

pub fn set_tolerance(&mut self, tolerance: Smpl)

Change yin or yinfft tolerance threshold

Source

pub fn get_tolerance(&self) -> Smpl

Get yin or yinfft tolerance threshold

Source

pub fn set_silence(&mut self, silence: Smpl)

Set the silence threshold of the pitch detection object

Source

pub fn get_silence(&self) -> Smpl

Get the silence threshold of the pitch detection object

Source

pub fn set_unit(&mut self, unit: PitchUnit)

Set the output unit of the pitch detection object

Source

pub fn get_confidence(&self) -> Smpl

Get the current confidence of the pitch algorithm

Trait Implementations§

Source§

impl Drop for Pitch

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.