Companion
object Companion
Functions
Link copied to clipboard
fun fromAudio(samples: FloatArray, sampleRate: Int, segments: List<Segment>, keyHz: Float, pitchContour: PitchContour? = null, hpcpFrames: List<FloatArray>? = null, lessonType: LessonType = LessonType.SINGALONG): LessonMaterial
Create a LessonMaterial from raw audio samples.
Link copied to clipboard
fun reconcileSegments(segments: List<Segment>, lessonType: LessonType, audioDurationSec: Float): Pair<List<Segment>, List<String>>
Reconcile already-built Segments against the declared lessonType (see segmentsFromTrans for the rules). Authoring tools (the lesson-extractor) call this directly on segments built from other inputs and surface the returned warnings in their run summaries; runtime loading goes through segmentsFromTrans.
Link copied to clipboard
fun segmentsFromTrans(trans: TransData, lessonType: LessonType, audioDurationSec: Float, onWarning: (String) -> Unit = { Logger.w(WARN_TAG, it) }): List<Segment>
Build this lesson's Segments from a parsed .trans (TransData), with lessonType as the authority for the mapping: