[模拟麦克风验收]:完成自动化语音闭环自测,包含模拟音频输入、两轮Pipeline验证和fixture回放

This commit is contained in:
mkbk
2026-06-17 23:04:20 +08:00
parent 8c75fc5baf
commit b3566c2424
10 changed files with 445 additions and 0 deletions
@@ -105,6 +105,31 @@ The live runtime SHALL run wake, VAD, STT, realtime transcript, TTS, and capture
- **WHEN** local noise filtering and local STT run during capture
- **THEN** raw PCM, denoised PCM, VAD features, partial transcript metadata, and temporary speaker profile data SHALL remain process-local and SHALL NOT be sent to the cloud LLM
### Requirement: Simulated microphone live acceptance
The system SHALL provide a deterministic simulated microphone acceptance command that exercises the current live `VoiceAssistantPipeline` without requiring a human to speak into a physical microphone.
#### Scenario: Simulated live command completes repeated turns
- **WHEN** the developer runs `.venv/bin/python -m owner_voice_pet simulate-live --turns 2`
- **THEN** the command SHALL feed simulated microphone audio frames into the live pipeline and complete two wake-to-playback turns
- **AND** the JSON output SHALL report two completed turns, zero failed turns, two final transcripts, two LLM calls, at least two playback completions, and standby resumed after each turn
#### Scenario: Simulated input includes noisy realtime partials
- **WHEN** simulated formal question frames contain short noisy partial text such as `家` or `家确`
- **THEN** realtime transcript output SHALL filter those short noise partials and SHALL only report stable question text
#### Scenario: Simulated input includes background speech after the user stops
- **WHEN** simulated background speech remains after the primary speaker frames end
- **THEN** primary speaker endpointing SHALL close the formal utterance and SHALL NOT merge later simulated turns into the current question
#### Scenario: Simulated command can write and replay fixtures
- **WHEN** the developer passes `--write-fixture path.jsonl`
- **THEN** the command SHALL write the generated simulated microphone frames as JSONL
- **AND** a later run using `--fixture path.jsonl` SHALL replay the same frames and produce equivalent successful live acceptance results
#### Scenario: Simulated microphone frames are exhausted unexpectedly
- **WHEN** the simulated microphone transport runs out of frames before the expected turn completes
- **THEN** the command SHALL fail with a structured error instead of waiting indefinitely
### 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.