extract
fun extract(samples: FloatArray, sampleRate: Int, segments: List<Segment>, keyHz: Float, contourExtractor: PitchContourExtractor, config: ReferenceExtractorConfig = ReferenceExtractorConfig.DEFAULT): LessonMaterial
Pre-extract reference features into a LessonMaterial.
Return
A LessonMaterial with pitch contour and HPCP frames populated.
Parameters
samples
Reference audio, mono. Resampled to 16 kHz internally.
sample Rate
Sample rate of samples in Hz.
segments
Phrase boundaries + lyrics for the lesson.
key Hz
Tonic frequency in Hz.
contour Extractor
Pitch contour extractor; caller owns its lifecycle.
config
HPCP frame geometry (must match the consuming session).
Throws
if samples is empty, sampleRate <= 0, keyHz <= 0, or segments is empty.