Skip to content

Add diary audio playback - #74

Merged
RANGROO merged 3 commits into
unstablefrom
codex/diary-audio-playback
Aug 5, 2026
Merged

Add diary audio playback#74
RANGROO merged 3 commits into
unstablefrom
codex/diary-audio-playback

Conversation

@RANGROO

@RANGROO RANGROO commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a server-side diary audio endpoint that resolves the diary author and uses their configured NPC TTS voice
  • add Play/Stop Audio controls to diary rows, the diary detail modal, and the latest diary card on the homepage
  • split long diary narration into sentence-aligned segments of at most 240 characters before synthesis
  • combine compatible WAV segments into one cached diary file, preserving the existing browser and plugin response contract
  • replace the always-visible person datalist with the HerikaServer-style Calendar and Filter by Person modes
  • show a searchable person card with entry counts, then display the selected character's complete diary newest-first

Root cause

The initial implementation passed the complete diary to the configured TTS provider in one request. The current 857-character diary exceeded Chatterbox's intended input size and produced only 20.6 seconds of garbled audio. Versioned segmented caching prevents that bad full-entry WAV from being reused.

Validation

  • php -l diary_audio.php
  • php -l ui/diarylog.php
  • php -l ui/home.php
  • php tests/diary_gamets_conversion.php
  • verified invalid and valid endpoint responses against the local StobeServer runtime
  • regenerated the current 857-character diary as five segments between 62 and 230 characters
  • verified the five cached segment texts rejoin exactly to the normalized diary with no missing or reordered content
  • verified the combined audio is a valid mono PCM 16-bit, 24 kHz RIFF WAV lasting 59.52 seconds
  • verified cached replay returns the same combined hash in 85 ms
  • verified Play/Stop behavior on the diary page, diary modal, and homepage with no browser console errors
  • verified Calendar and Filter by Person active states, live person-list searching, person selection, newest-first complete diary results, return to Calendar, and embedded-mode preservation
  • verified the homepage control at mobile width; the person selector reuses the existing responsive HerikaServer people-list layout, and the diary table remains horizontally scrollable on mobile

Deployment

Deployed locally to /var/www/html/StobeServer. The one current local diary was regenerated under the new segmented cache as cd58b272dd05ca71df31c59c26b794b9.wav. Local configuration, profiles, voices, and data were preserved.

Compatibility

The endpoint still returns one final WAV hash, so the matching STOBE plugin requires no protocol change for segmented generation. Existing ?person= diary links continue to enter person-filter mode.

Related

@RANGROO
RANGROO marked this pull request as ready for review August 5, 2026 05:02
@RANGROO
RANGROO merged commit 94f630d into unstable Aug 5, 2026
1 check 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.

1 participant