[唤醒应答与快速端点]:完成唤醒后我在播报和本地VAD端点优化,包含缓冲清理、配置项和测试覆盖

This commit is contained in:
mkbk
2026-06-17 20:51:14 +08:00
parent 860c2909fc
commit 44f708a3dc
12 changed files with 224 additions and 7 deletions
@@ -11,6 +11,28 @@ The live runtime SHALL display the recognized user utterance text in the termina
- **WHEN** STT returns empty text, punctuation-only text, or an invalid transcript
- **THEN** the runtime SHALL NOT emit a misleading transcript as valid user input and SHALL recover to standby without invoking the LLM
### Requirement: Wake acknowledgement before recording
The live runtime SHALL provide an audible local acknowledgement after local wake detection and before it starts recording the user's formal question.
#### Scenario: Wake is detected
- **WHEN** the local wakeword provider detects “小杰小杰”
- **THEN** the runtime SHALL play a short acknowledgement such as “我在” before entering the user utterance recording state
#### Scenario: Acknowledgement playback finishes
- **WHEN** the acknowledgement playback completes
- **THEN** the runtime SHALL clear buffered microphone input captured during acknowledgement playback before starting VAD recording for the user's question
### Requirement: Fast user utterance endpointing
The live runtime SHALL use the project-local VAD model by default for user utterance endpoint detection and SHALL expose configurable silence timing so the recording stops promptly after the user stops speaking.
#### Scenario: User stops speaking after wake
- **WHEN** VAD observes the configured continuous silence duration after a started utterance
- **THEN** the runtime SHALL close the utterance segment and proceed to STT without waiting for the maximum recording duration
#### Scenario: Local VAD model is available
- **WHEN** `OWNER_VAD_PROVIDER=local`
- **THEN** the runtime SHALL use the project-local `sherpa-onnx` VAD model rather than a raw energy threshold for live user utterance endpointing
## MODIFIED Requirements
### Requirement: Wake word detection
@@ -56,7 +78,7 @@ The system SHALL provide a `run-live` command that performs real repeated voice
#### Scenario: Live runtime completes two turns
- **WHEN** the user wakes the system with “小杰小杰”, asks a question, hears the reply, then wakes it again and asks another question
- **THEN** the system SHALL complete local wake, recording, STT, transcript display, LLM, TTS, playback for both turns and SHALL return to standby after each turn
- **THEN** the system SHALL complete local wake, audible acknowledgement, recording, STT, transcript display, LLM, TTS, playback for both turns and SHALL return to standby after each turn
#### Scenario: Once mode completes one turn
- **WHEN** the user runs `PYTHONPATH=src python3.11 -m owner_voice_pet run-live --once`