Skip to content

feat(ai): keep the audio of short phrases that ai say repeats - #382

Merged
arthware-dev merged 2 commits into
feature/0.5.0-beta.1from
feat/ai-say-kept-phrases
Nov 2, 2026
Merged

arthware-dev merged 2 commits into
feature/0.5.0-beta.1from
feat/ai-say-kept-phrases

Conversation

@arthware-dev

Copy link
Copy Markdown
Contributor

Summary

  • stack ai say --keep keeps the audio of a phrase and plays it from there the next time, with no request to the speech server (also while it is busy or stopped). --prepare makes and keeps the audio and plays nothing.
  • Kept audio is named by a hash of the whole speech request, so another voice, model or clip is synthesized again; volume stays a play-time setting. Stored in ~/famstack-data/ai/kept-speech/, derived.
  • Without either flag nothing changes and nothing is kept.

Flag names: --keep modifies what say does (it still speaks), so a flag fits rule 3. --prepare is a flag rather than a verb because ai say is a single action; the two are mutually exclusive, and argparse refuses both together in one line naming both.

Merge mode: squash.

A bot says the same short phrases again and again ("Moment.", "Gern
geschehen."). Each one waited for the speech server: about a second
for German, more while the language model ran on the same oMLX.

`stack ai say --keep` synthesizes a phrase once, keeps its audio and
plays it from there afterwards, with no request to the speech server,
also while it is busy or stopped. `--prepare` makes and keeps the
audio and plays nothing, for a bot that prepares its phrases at start.

- Kept audio is named by the whole speech request, so another voice,
  model or clip is synthesized again. Volume is applied at play time.
- A kept phrase still waits its turn at the speaker.
- It lives in `~/famstack-data/ai/kept-speech/` and is derived.
- Without either flag `ai say` keeps nothing, as before.
Kept phrases moved to `~/famstack-data/ai/voice-snippets/<language>/`,
the language `ai say` resolved for the phrase. Each file is named by
the phrase's words as a lowercase ASCII slug (umlauts spelled out, at
most 40 characters) and a short hash of the whole speech request, for
example `de/gern-geschehen-91b0e4aa.mp3`, so a person can find and play
a phrase. The hash keeps another voice, model, clip or speed apart.
@arthware-dev
arthware-dev force-pushed the feat/ai-say-kept-phrases branch from 983222f to a57fcd8 Compare October 31, 2026 08:22
@arthware-dev
arthware-dev merged commit f19b1ab into feature/0.5.0-beta.1 Nov 2, 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