move vad config to json

This commit is contained in:
Xin Wang
2026-05-21 17:23:04 +08:00
parent 6a59df3dbd
commit 872b8ac64a
6 changed files with 135 additions and 1 deletions

View File

@@ -132,6 +132,41 @@ the TTS in the pipeline. `response.text.final` fires when the turn ends,
carrying the full concatenated assistant text and an `interrupted` flag
(true when an `input.text` or barge-in cut the turn short).
### Turn detection
User-turn segmentation (VAD thresholds + how long to wait after silence
before declaring the turn done) is configurable per environment:
```json
"turn": {
"vad": {
"confidence": 0.7,
"start_secs": 0.2,
"stop_secs": 0.6,
"min_volume": 0.6
},
"user_speech_timeout_sec": 1.0
}
```
- `vad.*` maps directly to `pipecat.audio.vad.vad_analyzer.VADParams` and
controls the Silero VAD. `stop_secs` is the duration of silence required
before VAD reports the user stopped speaking; raise it if VAD is
cutting users off mid-clause, lower it for snappier turn-taking.
- `user_speech_timeout_sec` is the additional grace window (used by
`SpeechTimeoutUserTurnStopStrategy`) during which the user may resume
speaking before the aggregator finalizes the turn. The timer is
re-armed every time the user resumes, so brief mid-sentence pauses do
not split one utterance into multiple LLM turns.
The total "user pause before turn ends" budget is approximately
`vad.stop_secs + user_speech_timeout_sec`. The repo defaults are tuned
slightly more conservatively than upstream pipecat to avoid streaming
ASRs (xfyun in particular) producing many short fragments per logical
utterance. Setting this stop strategy explicitly also replaces pipecat's
default Smart Turn v3 analyzer, so the engine no longer loads the
`smart-turn-v3.*-cpu.onnx` model at startup.
### Xfyun ASR
The STT provider can be switched to iFlytek/Xfyun's streaming voice dictation