PitchConfig

data class PitchConfig(val bufferSize: Int = 2048, val sampleRate: Int = 16000, val tolerance: Float = 0.15f, val minFreq: Float = 80.0f, val maxFreq: Float = 1000.0f, val refPitch: Float = 440.0f, val octaveWrap: Int = 0, val amplitudeGateThresholdDb: Float = -40f, val minConfidenceThreshold: Float = 0.75f)

Configuration for pitch detection (YIN algorithm).

Constructors

Link copied to clipboard
constructor(bufferSize: Int = 2048, sampleRate: Int = 16000, tolerance: Float = 0.15f, minFreq: Float = 80.0f, maxFreq: Float = 1000.0f, refPitch: Float = 440.0f, octaveWrap: Int = 0, amplitudeGateThresholdDb: Float = -40f, minConfidenceThreshold: Float = 0.75f)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

RMS amplitude threshold in dB for gating quiet frames. Frames below this threshold return unvoiced (-1). Range: -60 to -20, default -40.

Link copied to clipboard

Size of the audio buffer for analysis

Link copied to clipboard

Maximum detectable frequency in Hz

Link copied to clipboard

Minimum YIN confidence (0.0-1.0) to accept pitch. Frames below this threshold return unvoiced (-1). Range: 0.5 to 0.95, default 0.75.

Link copied to clipboard

Minimum detectable frequency in Hz

Link copied to clipboard

Whether to wrap octaves (0 = no, 1 = yes)

Link copied to clipboard

Reference pitch for A4 in Hz (default 440.0)

Link copied to clipboard

Audio sample rate in Hz

Link copied to clipboard

YIN algorithm tolerance (lower = more accurate, slower)