Skip to content

No test coverage for actual Pocket TTS audio output #107

Closed

Description

@libravault-xyz

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:

  1. Runs the real Pocket TTS pipeline (sherpa-onnx + espeak-ng, not mocked) against a known input string.
  2. 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 androidTest in core:tts similar to feature/reader's ReadiumIntegrationTest (real device, no mocking of the native layer).
  • Could run via the same Firebase Test Lab instrumentation path 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions