PitchContour

data class PitchContour(val samples: List<PitchPoint>, val sampleRate: Int = 16000)

A sequence of pitch points representing a pitch contour over time.

Replaces parallel arrays (times[], pitches[]) with a structured representation.

Constructors

Link copied to clipboard
constructor(samples: List<PitchPoint>, sampleRate: Int = 16000)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Duration of the contour in seconds

Link copied to clipboard

True if contour has no samples

Link copied to clipboard

Pitches in Hz (fast path). Unvoiced frames use -1.

Link copied to clipboard

Pitches in MIDI for native evaluator (fast path). Unvoiced frames use -1.

Link copied to clipboard

Original audio sample rate (default 16kHz)

Link copied to clipboard

List of pitch points in chronological order

Link copied to clipboard
val size: Int

Number of samples in the contour

Link copied to clipboard

Times array for native evaluator (fast path)

Link copied to clipboard

Ratio of voiced samples to total samples (0.0 - 1.0)

Functions

Link copied to clipboard
fun slice(startTime: Float, endTime: Float, relativeTimes: Boolean = true): PitchContour

Extract a slice of the contour within a time range.

Link copied to clipboard

Get pitches as a FloatArray (for compatibility with internal APIs).

Link copied to clipboard

Get times as a FloatArray (for compatibility with internal APIs).