feat: the brain can change the box's speaker volume

"Speak up" and "too loud" now work: the reply tool takes louder, in
percentage points, and the button service nudges the speaker's softvol
before it speaks that reply, so the person hears the change at once.
The box keeps the level between 10% and 80% (body/mixer.py).

No new port or key: the volume changes only with a reply, in a
conversation someone is listening to.

Generated-by: Claude Opus 5.5
This commit is contained in:
dckc committed 2026-12-03 16:44:54 -06:00
1 parent cf503ac247
commit 5191ee9931
11 files changed
+146 -21

No files matched your search

+5 -1
View File
@@ -25,17 +25,21 @@ def answer(line):
>>> answer(b'{"say": "Let me try."}')
('say', 'Let me try.')
>>> answer(b'{"louder": -10}')
('louder', -10)
>>> answer(b'{"reply": "Bye!", "end": true}')
('reply', 'Bye!', True)
"""
event = json.loads(line)
if "say" in event:
return ("say", event["say"])
if "louder" in event:
return ("louder", int(event["louder"]))
return ("reply", event["reply"], bool(event.get("end")))
class Brain:
"""ask(text, convo) yields ("say", text)s, then ("reply", text, end); or ("press",).
"""ask(text, convo) yields ("say", text)s, perhaps ("louder", points), then ("reply", text, end); or ("press",).
end(convo) tells the brain the conversation is over.
ask_client is a Command for ask-client, bound to the brain's ask capability.