Skip to content

fix(tts): progressive Persian playback for real browser content - #70

Merged
AmirMotefaker merged 1 commit into
mainfrom
fix/69-progressive-tts-playback
Sep 6, 2026
Merged

fix(tts): progressive Persian playback for real browser content#70
AmirMotefaker merged 1 commit into
mainfrom
fix/69-progressive-tts-playback

Conversation

@AmirMotefaker

Copy link
Copy Markdown
Collaborator

Fixes #69.

Real-browser blocker

The merged direct-fetch fix correctly prevents an infinite hang, but realistic Chrome content still reaches the 90s startup timeout, including Summary mode.

Root cause

The Worker may synthesize multiple narration chunks before returning a single WAV. That means browser playback waits for the whole narration instead of starting from the first available segment.

Fix

  • split prepared Persian narration into ~900-character playback chunks in the extension;
  • synthesize only the current chunk;
  • start playback immediately when the first chunk arrives;
  • automatically request the next chunk after the current audio ends;
  • show visible progress (بخش x از y);
  • preserve female/male voice selection and Play/Pause/Resume/Stop;
  • on later server failure, browser fallback continues from remaining chunks instead of restarting the whole article;
  • retain the bounded 90s timeout per chunk;
  • no secret exposure and no stable/store publication.

Acceptance

CI + candidate + Cloudflare E2E must pass, then repeat the exact real Chrome summary/full tests before Stable.

Refs #61 #65 #67 #68 #69

@AmirMotefaker
AmirMotefaker marked this pull request as ready for review September 6, 2026 12:36
@AmirMotefaker
AmirMotefaker merged commit 20d9da8 into main Sep 6, 2026
2 checks passed
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.

Stream Persian TTS progressively so playback starts before whole article is synthesized

1 participant