#[non_exhaustive]pub struct PitchConfig {
pub threshold: f32,
pub min_frequency_hz: f32,
pub max_frequency_hz: f32,
}Expand description
The acquisition sensitivity and the bounds for pitch reports to the host.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.threshold: f32The normalized cycle-difference threshold for acquisition, 0.002..=0.2.
The default is 0.1. Larger values accept less exact cycle agreement. This value controls acquisition. It is not an output gain or an amplitude gate.
min_frequency_hz: f32The lower bound of the feedback in hertz (inclusive), 40..=2000.
The default is 40. It must be strictly less than max_frequency_hz.
These bounds do not change the tracking, the correction or the
resampling. A feedback query applies the current bounds to the kept
analysis. It does not process another sample.
max_frequency_hz: f32The upper bound of the feedback in hertz (inclusive), 40..=2000.
The default is 1100. It must be strictly greater than
min_frequency_hz. Results outside the bounds are reported as
unvoiced, with zero frequency and zero period.
Implementations§
Source§impl PitchConfig
impl PitchConfig
Sourcepub fn validate(self) -> Result<(), Error>
pub fn validate(self) -> Result<(), Error>
Checks the threshold, then each frequency range, then the order of the frequencies.
§Errors
Returns Error::InvalidConfig for a value that is not finite or is
out of range. If the bounds are equal or reversed, the error has the
field resynthesis.pitch.min_frequency_hz and the problem
ConfigProblem::Unordered. The other value of that problem is
resynthesis.pitch.max_frequency_hz.