[真实链路自测]:完成完整流程自测和ACK缓冲修正,包含真实Provider验收、播放回声清理和回归测试
This commit is contained in:
@@ -238,6 +238,31 @@ The generated sequence intentionally contains:
|
||||
|
||||
The transport is bounded: if frames are exhausted unexpectedly, it raises a structured validation error instead of letting the pipeline loop forever. `--write-fixture` writes the exact simulated microphone frames as JSONL, and `--fixture` replays them for repeatable debugging.
|
||||
|
||||
## Real Provider Fixture Acceptance and Playback Drain
|
||||
|
||||
The simulated microphone command validates pipeline ordering with fake providers, but it does not prove that real local models and real playback can run together. The next acceptance layer uses generated 16 kHz PCM utterances as microphone input while keeping the provider chain real:
|
||||
|
||||
```text
|
||||
generated wake/question PCM
|
||||
-> MemoryAudioTransport(flush preserves prefilled fixture frames)
|
||||
-> SherpaOnnxKeywordWakeWordProvider(real KWS)
|
||||
-> HybridVadProvider(real sherpa VAD + energy fallback)
|
||||
-> SherpaOnnxDenoiserPreprocessor(real GTCRN)
|
||||
-> PrimarySpeakerVadRecorder
|
||||
-> SherpaOnnxSttProvider(real local CTC partial/final)
|
||||
-> OpenAICompatibleLlmProvider(real cloud LLM from .env)
|
||||
-> MacSayTtsProvider(real macOS TTS)
|
||||
-> SoundDeviceAudioTransport.play_pcm(real speaker smoke)
|
||||
```
|
||||
|
||||
Playback drain semantics are intentionally split by transport type:
|
||||
|
||||
1. `SoundDeviceAudioTransport.flush_input()` clears the realtime callback queue that accumulated during ACK/TTS playback.
|
||||
2. `MemoryAudioTransport` defaults to the same destructive flush behavior for direct unit tests.
|
||||
3. Simulated and fixture-driven live tests set `flush_clears_input=False` because their queued frames represent future time-ordered microphone input, not already accumulated realtime echo.
|
||||
|
||||
`_drain_input_after_playback()` therefore always calls `flush_input()` once after actual playback. If `OWNER_POST_PLAYBACK_DRAIN_MS=0`, it returns immediately and does not perform any timed read/drop loop. If the value is positive, the positive window is treated as an explicit user tuning and the runtime reads and discards only that configured duration before a final flush. When `OWNER_WAKE_ACK_TEXT` is empty and no ACK playback occurs, the runtime skips playback drain entirely.
|
||||
|
||||
## Migration
|
||||
|
||||
No database migration. Users should run:
|
||||
|
||||
Reference in New Issue
Block a user