pub struct DelayedFingerprinter { /* private fields */ }
Expand description
DelayedFingerprinter allows you to generate Chromaprint fingerprints at a higher resolution than allowed by default.
By design, Chromaprint requires at least 3 seconds of audio to generate a fingerprint. To get more precise fingerprints, we can use multiple Contexts separated by a fixed delay. For example, to obtain a fingerprint for each second of audio, run 3 contexts separated by one second.
DelayedFingerprinter abstracts this logic out into a simple API. Once created, you just need to
call feed()
and check if any hashes were returned. Each hash will be accompnaied with a timestamp
that indicates when the fingerprint was generated.
Implementations§
Source§impl DelayedFingerprinter
impl DelayedFingerprinter
pub fn new( n: usize, interval: Duration, delay: Duration, sample_rate: Option<u32>, num_channels: u16, algorithm: Option<Algorithm>, ) -> Self
pub fn interval(&self) -> Duration
pub fn sample_rate(&self) -> u32
pub fn clock(&self) -> Duration
pub fn feed( &mut self, samples: &[i16], ) -> Result<Vec<(Fingerprint<Raw>, Duration)>, Error>
Auto Trait Implementations§
impl Freeze for DelayedFingerprinter
impl RefUnwindSafe for DelayedFingerprinter
impl !Send for DelayedFingerprinter
impl !Sync for DelayedFingerprinter
impl Unpin for DelayedFingerprinter
impl UnwindSafe for DelayedFingerprinter
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