Repository navigation
Description
Gap
Every existing Pocket TTS test (PocketTtsEngineTest, PocketModelManagerTest, PocketVoiceCatalogTest, PocketPlaybackTest) exercises engine lifecycle, model management, and playback plumbing — none of them actually run the ONNX/sherpa-onnx phonemization+synthesis pipeline and check the resulting audio. There's no assertion anywhere in the repo that English text actually produces correct, non-silent, non-garbled speech.
This surfaced concretely during PR #106, which removed 111 unused non-English espeak-ng-data phonemizer dictionaries. That change was verified via unit tests (engine/lifecycle only), a clean build, and a Firebase Test Lab Robo test (crash-free) — but none of that confirms English phonemization/audio still sounds correct, only that nothing crashes without the removed files. See [[project_espeak_dict_trim]] / [[project_pocket_tts_plan]] (internal memory) for the same "no on-device audio test yet" gap noted back at the original Pocket TTS implementation (PR #78).
What's needed
An instrumentation (on-device) test that:
- Runs the real Pocket TTS pipeline (sherpa-onnx + espeak-ng, not mocked) against a known input string.
- Asserts something meaningful about the output — at minimum: non-empty/non-silent PCM output, plausible duration for the input length, no synthesis errors/exceptions. Ideally: some audio-fingerprint or duration-based regression check against a known-good reference so future changes (dict trims, model swaps, sherpa-onnx version bumps) can be verified automatically instead of by ear.
Suggested approach (not scoped/committed — decide in the session that picks this up)
- Add an
androidTestincore:ttssimilar tofeature/reader'sReadiumIntegrationTest(real device, no mocking of the native layer). - Could run via the same Firebase Test Lab
instrumentationpath already verified working (see [[project_firebase_test_lab_robo_run]]) — free quota, no new infra needed. - Consider a golden-file / reference-waveform comparison (e.g., RMS energy over time, or basic duration/silence checks) rather than exact byte-for-byte audio matching, since ONNX runtime output can have minor non-determinism across devices/architectures.
🤖 Filed by Claude Code
Activity
feat(markdown): render Mermaid diagrams via a bundled offline renderer (
test(ios): cover PocketTTSEngine's ttsCallback retain/release contract
test(ios): cover PocketTTSEngine's pure logic behind the XCTest guard (…