Skip to content

fix(setup-tab): retry next WAV player when Piper preview playback fails - #209

Draft
paulpreibisch wants to merge 1 commit into
masterfrom
worktree-fix-piper-preview-fallback
Draft

fix(setup-tab): retry next WAV player when Piper preview playback fails#209
paulpreibisch wants to merge 1 commit into
masterfrom
worktree-fix-piper-preview-fallback

Conversation

@paulpreibisch

Copy link
Copy Markdown
Owner

Summary

  • The provider-config wizard's Piper voice picker (setup-tab.js _previewVoice) picked a single WAV player via detectWavPlayer() and never checked its exit code, so a present-but-broken player failed silently with no sound and no error message.
  • Root cause reproduced on this machine: sox's play (installed via scoop) is detected before ffplay/PowerShell, but exits 1 with "no default audio device configured" — the picker just showed "♪ Playing..." then went quiet.
  • Kokoro previews don't hit this because they bypass the WAV_PLAYERS list entirely (hardcoded PowerShell SoundPlayer), and the separate Voices tab already has retry-on-failure logic via getAllWavPlayers() — this brings the setup-tab picker in line with that existing pattern.

Test plan

  • node --test test/unit/setup-tab-preview-routing.test.js test/unit/tui-voice-preview-routing.test.js test/unit/setup-tab-audio-suppress.test.js — 53/53 pass
  • bash scripts/run-tests.sh (full suite: syntax, bats, coverage) — exit 0
  • Manually confirmed on this machine: sox play exits 1 ("no default audio device"), ffplay (next in the fallback chain) plays the same file successfully with exit 0

🤖 Generated with Claude Code

The provider-config wizard's Piper voice picker used detectWavPlayer()
(first match only) with no exit-code check on the playback process, so a
present-but-broken player (e.g. sox's `play` on Windows exiting 1 with
"no default audio device configured") failed silently — no sound, no
error. Kokoro and the separate Voices tab avoid this because they either
bypass WAV_PLAYERS entirely (Kokoro hardcodes PowerShell SoundPlayer) or
already retry the next player on failure (voices-tab.js). Apply the same
getAllWavPlayers() + retry-until-one-succeeds pattern here.
@sonarqubecloud

sonarqubecloud Bot commented Jul 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant