feedContour

abstract fun feedContour(samples: FloatArray, sampleRate: Int, anchorTime: Float)

Stream raw audio into pitchContour.

The detector buffers the audio, runs YIN/SwiftF0 + smoother at its own hop rate, and writes the resulting points to the contour. Each emission within a single call is stamped by back-spreading from anchorTime by the detector's hop: the latest emission lands at anchorTime, the previous one at anchorTime - hopSec, etc.

Use this when the caller owns the audio source (e.g. recorder buffers in a live evaluation pipeline) and wants a contour aligned to an external clock such as audible player time. Pair with clearPitchContourFrom for segment-aware retry / seek-back.

Decouples contour streaming from detect, so the same detector can be used for pure single-shot work without paying for contour maintenance, or for streaming without paying for the duplicate single-shot return.

Parameters

samples

Raw audio samples (any size)

sampleRate

Sample rate of the input audio

anchorTime

Time, in the caller's domain, of the LATEST sample in samples (typically audible-player- time minus input latency).