Repository navigation
feat(ai): keep the audio of short phrases that ai say repeats - #382
Merged
Merged
Conversation
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
force-pushed
the
feat/ai-say-kept-phrases
branch
from
October 31, 2026 08:22
983222f to
a57fcd8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
stack ai say --keepkeeps 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).--preparemakes and keeps the audio and plays nothing.~/famstack-data/ai/kept-speech/, derived.Flag names:
--keepmodifies whatsaydoes (it still speaks), so a flag fits rule 3.--prepareis a flag rather than a verb becauseai sayis a single action; the two are mutually exclusive, and argparse refuses both together in one line naming both.Merge mode: squash.