ContourExtractorConfig

data class ContourExtractorConfig(val preset: PitchPreset = PitchPreset.BALANCED, val algorithm: PitchAlgorithm = PitchAlgorithm.SWIFT_F0, val sampleRate: Int = 16000, val hopMs: Int = 10, val cleanup: PitchProcessingConfig = PitchProcessingConfig.SCORING, val voiceType: VoiceType = VoiceType.Auto, val quietHandling: QuietHandling = QuietHandling.NORMAL, val strictness: DetectionStrictness = DetectionStrictness.BALANCED)

Configuration for batch pitch contour extraction (ADR-001).

Passed to PitchDetection.createContourExtractor. Controls which algorithm is used, the hop size between frames, and the post-processing cleanup applied.

Usage Tiers

Tier 1: Presets (80% of users)

val extractor = PitchDetection.createContourExtractor(
ContourExtractorConfig.SCORING,
modelProvider = { ModelLoader.loadSwiftF0() }
)

Tier 2: Builder (15% of users)

val config = ContourExtractorConfig.Builder()
.preset(ContourExtractorConfig.SCORING)
.sampleRate(16000)
.hopMs(10)
.build()
val extractor = PitchDetection.createContourExtractor(config, modelProvider = { ... })

Tier 3: .copy() (5% of users)

val config = ContourExtractorConfig.SCORING.copy(hopMs = 5)

See also

PitchDetection.createContourExtractor

Factory that accepts this config

PitchContourExtractor

The extractor constructed from this config

The cleanup pipeline applied after extraction

Constructors

Link copied to clipboard
constructor(preset: PitchPreset = PitchPreset.BALANCED, algorithm: PitchAlgorithm = PitchAlgorithm.SWIFT_F0, sampleRate: Int = 16000, hopMs: Int = 10, cleanup: PitchProcessingConfig = PitchProcessingConfig.SCORING, voiceType: VoiceType = VoiceType.Auto, quietHandling: QuietHandling = QuietHandling.NORMAL, strictness: DetectionStrictness = DetectionStrictness.BALANCED)

Types

Link copied to clipboard
class Builder

Builder for ContourExtractorConfig.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Pitch detection algorithm

Link copied to clipboard

Post-processing configuration

Link copied to clipboard
val hopMs: Int

Hop size between pitch samples in milliseconds

Link copied to clipboard

Detection preset for resolution/accuracy trade-off

Link copied to clipboard

How to handle quiet audio

Link copied to clipboard

Input audio sample rate in Hz

Link copied to clipboard

Detection strictness level

Link copied to clipboard

Voice type for frequency range optimization