[低延迟端点]:完成首句保留和快速结束修正,包含ACK缓冲策略、批量读帧和主说话人端点回归测试

This commit is contained in:
mkbk
2026-06-17 22:04:25 +08:00
parent e74ec28e7d
commit a64bb86da4
15 changed files with 136 additions and 15 deletions
@@ -26,6 +26,25 @@ The live runtime SHALL support a per-turn primary speaker endpoint mode that end
- **WHEN** the process exits
- **THEN** no primary speaker profile SHALL be stored or reused across runs
### Requirement: Low latency capture and first utterance preservation
The live runtime SHALL preserve the start of the user's formal utterance after wake acknowledgement and SHALL end capture promptly after the primary speaker stops.
#### Scenario: Acknowledgement finishes before the user speaks
- **WHEN** acknowledgement playback completes and the runtime enters capture
- **THEN** the runtime SHALL NOT perform an additional timed microphone read-and-discard window before listening for the user's formal question
#### Scenario: Queued microphone frames are available
- **WHEN** the live microphone transport has multiple frames queued
- **THEN** the transport SHALL return the available batch to the pipeline so wake and capture stages do not process stale audio one frame at a time
#### Scenario: Primary speaker profile becomes ready quickly
- **WHEN** the user starts the formal utterance after wake
- **THEN** the primary speaker endpoint SHALL use an independent profile readiness threshold no greater than the configured `OWNER_SPEAKER_PROFILE_MIN_MS` rather than waiting for generic VAD minimum duration
#### Scenario: User stops after a short first question
- **WHEN** the primary speaker profile is ready and the primary speaker disappears for the configured absence duration
- **THEN** capture SHALL close the utterance and proceed to STT without waiting for a second repeated question or generic VAD minimum duration
### Requirement: Realtime transcript terminal output
The live runtime SHALL display the recognized user utterance text in the terminal after STT succeeds and before the LLM request is sent.
@@ -46,7 +65,7 @@ The live runtime SHALL provide an audible local acknowledgement after local wake
#### 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
- **THEN** the runtime SHALL clear buffered microphone input captured during acknowledgement playback before starting VAD recording for the user's question and SHALL NOT discard additional post-acknowledgement user speech by default
### Requirement: Fast user utterance endpointing
The live runtime SHALL use project-local VAD capability with an energy-threshold fallback by default for user utterance endpoint detection and SHALL expose configurable silence timing so the recording stops promptly after the user stops speaking.