Skip to main content

Panako

Struct Panako 

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

Panako offline fingerprinter.

§Example

use audiofp::{AudioBuffer, Fingerprinter, SampleRate};
use audiofp::classical::Panako;

let mut fp = Panako::default();
let samples = vec![0.0_f32; 8_000 * 3];
let buf = AudioBuffer { samples: &samples, rate: SampleRate::HZ_8000 };
let fpr = fp.extract(buf).unwrap();
assert_eq!(fpr.frames_per_sec, 62.5);
assert!(fpr.hashes.is_empty());

Implementations§

Source§

impl Panako

Source

pub fn new(cfg: PanakoConfig) -> Self

Build a Panako extractor with the given config.

Trait Implementations§

Source§

impl Default for Panako

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Fingerprinter for Panako

Source§

type Output = PanakoFingerprint

The fingerprint produced by this extractor (e.g. Vec<WangHash>).
Source§

type Config = PanakoConfig

Per-instance configuration this fingerprinter exposes to callers.
Source§

fn name(&self) -> &'static str

Stable identifier for the algorithm and version, e.g. "wang-v1". Useful when persisting fingerprints alongside the producer name.
Source§

fn config(&self) -> &Self::Config

Borrow the configuration this instance was built with.
Source§

fn required_sample_rate(&self) -> u32

Sample rate, in hertz, the fingerprinter expects its input at. Resampling is the caller’s responsibility.
Source§

fn min_samples(&self) -> usize

Minimum buffer length, in samples, required to extract anything. Calls with shorter inputs return AfpError::AudioTooShort.
Source§

fn extract(&mut self, audio: AudioBuffer<'_>) -> Result<Self::Output>

Compute the fingerprint of audio.

Auto Trait Implementations§

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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

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.