STVADParams
Configures voice activity detection (VAD) for audio recording.
Overview
Voice activity detection (VAD) distinguishes likely speech from surrounding silence during recording. Configure sensitivity and silence handling to influence how the recorder finds utterance boundaries. VAD settings interact with recording stop conditions and can affect whether short or quiet speech is captured.
public struct STVADParams: Sendable {
public var enableVAD: Bool = true
public var vadSensitivity: STVADSensitivity = .low
public var vadMinSpeechToDetectMs: Int = 0
public var vadMinSilenceToDetectMs: Int = 0
public var recordAudioWithNoSpeechActivity: Bool = true
public var preVADAudioFileName: String? = nil
}
Properties
enableVAD enables voice activity detection. Default: true.
vadSensitivity selects the VAD sensitivity. Default: .low.
vadMinSpeechToDetectMs specifies the minimum speech duration used before transitioning to speech state. 0 leaves this threshold to the internal sensitivity behavior.
vadMinSilenceToDetectMs specifies the minimum silence duration used before transitioning to silence state. 0 leaves this threshold to the internal sensitivity behavior.
recordAudioWithNoSpeechActivity determines whether audio without detected speech activity remains in the recorded output. Default: true.
preVADAudioFileName optionally records the incoming audio before VAD filtering/retention behavior is applied.
Properties
enableVAD— Declared as Bool.vadSensitivity— Declared asSTVADSensitivity.vadMinSpeechToDetectMs— Declared as Int.vadMinSilenceToDetectMs— Declared as Int.recordAudioWithNoSpeechActivity— Declared as Bool.preVADAudioFileName— Declared as String.