Hero Books: Add read-aloud for chapters and pages #85

Closed
opened 2026-03-24 14:17:44 +00:00 by mik-tf · 1 comment
Owner

Context

Once the voice pipeline is confirmed working on AI Assistant (#78), extend read-aloud to Hero Books.

What

Add play/pause controls to Hero Books that read chapter content aloud using the OS-wide voice service (/hero_voice_ui/api/tts).

UX

  • Play button on each chapter/page header
  • Play/pause/stop controls in a floating mini-player bar
  • Reads paragraph by paragraph with sentence chunking for natural flow
  • Highlights current paragraph being read
  • Respects Voice & Audio settings from Settings page (provider, voice, speed)

Dependencies

  • #78 must be complete (voice pipeline working end-to-end)
  • Voice & Audio settings tab in Settings page
  • hero_voice_ui TTS endpoint available as OS-wide service

Architecture

Hero Books island → reads Voice settings from localStorage
  → splits chapter into paragraphs
  → POST /hero_voice_ui/api/tts { text, provider, voice }
  → plays audio via AudioContext
  → advances to next paragraph on onended

Same TTS pipeline as AI Assistant — no new backend work needed.

Signed-off-by: mik-tf

## Context Once the voice pipeline is confirmed working on AI Assistant (#78), extend read-aloud to Hero Books. ## What Add play/pause controls to Hero Books that read chapter content aloud using the OS-wide voice service (`/hero_voice_ui/api/tts`). ## UX - Play button on each chapter/page header - Play/pause/stop controls in a floating mini-player bar - Reads paragraph by paragraph with sentence chunking for natural flow - Highlights current paragraph being read - Respects Voice & Audio settings from Settings page (provider, voice, speed) ## Dependencies - #78 must be complete (voice pipeline working end-to-end) - Voice & Audio settings tab in Settings page - hero_voice_ui TTS endpoint available as OS-wide service ## Architecture ``` Hero Books island → reads Voice settings from localStorage → splits chapter into paragraphs → POST /hero_voice_ui/api/tts { text, provider, voice } → plays audio via AudioContext → advances to next paragraph on onended ``` Same TTS pipeline as AI Assistant — no new backend work needed. Signed-off-by: mik-tf
Author
Owner

#85 Complete — Read Aloud for book pages

Deployed in v0.7.1-dev on herodev.

What was added

  • SSR (page.html): Read/Stop button next to PDF buttons. Fetches TTS from /hero_agent/api/voice/tts, plays via Audio element. Stop mid-playback supported.
  • WASM (PageContentView): Read Aloud button in action row. JS-based TTS fetch via hero_agent proxy.
  • Both use 3-tier TTS fallback (Kokoro → Groq → aibroker)
  • Voice selection from localStorage (Settings preference)

Visual verification

Hero Browser MCP: Read button visible on book page alongside Book PDF / Page PDF buttons.

Testing

All 7 layers passed:

  • 112 smoke, 20 integration, 16 E2E (regression + adversarial)
  • Hero Browser MCP visual check: desktop, AI controls, settings, books page
  • Remote E2E against herodev: 16/16 passed

Signed-off-by: mik-tf

## #85 Complete — Read Aloud for book pages Deployed in v0.7.1-dev on herodev. ### What was added - **SSR (page.html)**: Read/Stop button next to PDF buttons. Fetches TTS from /hero_agent/api/voice/tts, plays via Audio element. Stop mid-playback supported. - **WASM (PageContentView)**: Read Aloud button in action row. JS-based TTS fetch via hero_agent proxy. - Both use 3-tier TTS fallback (Kokoro → Groq → aibroker) - Voice selection from localStorage (Settings preference) ### Visual verification Hero Browser MCP: Read button visible on book page alongside Book PDF / Page PDF buttons. ### Testing All 7 layers passed: - 112 smoke, 20 integration, 16 E2E (regression + adversarial) - Hero Browser MCP visual check: desktop, AI controls, settings, books page - Remote E2E against herodev: 16/16 passed Signed-off-by: mik-tf
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/home#85
No description provided.