feat(app): an earcon tells the speaker Jarvis took the call

A short two-tone chime, made in code, plays right before each voice answer
starts and at once for a wake word said alone while Jarvis is free; the
question that joins it gets no second one. call.earcon turns it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 10:30:55 +09:00
parent 1bebc1c531
commit cefe9b9253
9 changed files with 224 additions and 14 deletions

View File

@@ -32,6 +32,7 @@ Settings (`settings.json`, section `call`; wake words stay in `voice.wakeWords`)
| `call.designatedOnly` | `false` | Answer only designated people. |
| `call.designatedNoWakeWord` | `false` | Answer designated people without a wake word. |
| `call.stopWords` | `["멈춰", "그만", "정지", "stop"]` | Said together with a wake word, they stop Jarvis in any policy. |
| `call.earcon` | `true` | Play the earcon (below) when Jarvis takes a voice call. |
| `call.followUpMs` | `1500` | After a wake word said alone, how long the speaker's next utterance may take to start and still be joined to it. 0-5000. |
Normalisation: Unicode NFKD, lower case, and only letters and digits kept (spaces, punctuation and
@@ -68,6 +69,14 @@ connection (`WorkerLost`): the final it waited for will not come, and the restar
utterances are not continuations of it. Chat messages are not joined:
a message is complete as sent.
**Earcon.** A short two-tone "띠링" (about 0.3 s, made by the app, `app/src/earcon.rs`) tells the
speaker Jarvis heard the call, long before the answer is written: it is the first sound after a call.
It plays right before each voice answer starts (the policy's `Answer`), and at once when a wake word
said alone is kept waiting while no answer is running (the question that joins it then gets no second
earcon). It is queued like speech, so it waits behind speech already queued and a stop drops it. A
call the policy does not take (busy, replaced, stopped) gets none, nor does a wake word alone while an
answer runs. Chat answers get none. `call.earcon: false` turns it off.
## Response policy
Settings (section `response`):
@@ -160,7 +169,7 @@ never takes the voice turn and never goes through the response policy.
`app/src/conversation.rs` runs between the core's events and everything else that reads them (every
event is passed on unchanged). It talks to the core through a small `Voice` interface (answer, cancel
one request, stop all, ask "addressed", ask "rank"), so the glue is tested with a fake.
one request, stop all, earcon, ask "addressed", ask "rank"), so the glue is tested with a fake.
- `Chat` and `ReplyText`: chat calls, above.
- `SpeechStart` opens the speaker's utterance; `SpeakingStopped` marks it ending.
@@ -170,7 +179,8 @@ one request, stop all, ask "addressed", ask "rank"), so the glue is tested with
goes to the policy. Ask sends `addressed` to the brain; a yes becomes the request, a no (or a failed
judgement) closes the utterance, and no answer within 5 s counts as no, also when the answer arrives
after that but before the timer ran.
- Policy actions: `Answer` → `answer(user, text)` (the brain answers and the answer is spoken; when it
- Policy actions: `Answer` → the earcon (unless it already played for this request), then
`answer(user, text)` (the brain answers and the answer is spoken; when it
cannot be queued the answer is done at once); `StopAnswer` → `cancel` of that answer's speech;
`Rank { id }` → `rank` with id `k<id>` and the candidates' request ids; `Missed` → a debug log and
the missed list (the last 100: speaker, reason, time and length, never the text).
@@ -191,7 +201,8 @@ two letters away, wake word anywhere, stop with and without a wake word, designa
modes) and every policy rule above with fake times (settling, ordering by end time, busy, queue limit,
interruption, ranking tie, ranking timeout, stop dropping the queue), and the conversation loop with a
fake voice side (answering and queueing, a busy drop recorded without text, voice stop, addressed yes,
no and timeout, interruption cancelling the right speech, a ranking deciding, end times from
no and timeout, the earcon before each answer, once for a wake word alone, none while busy or when
off, interruption cancelling the right speech, a ranking deciding, end times from
`wait_ms`, and chat: an answer posted as a reply once, per-channel switches, no answers to bots or to
a stop, chat wake words and designated people, a failed answer posting nothing). `tests/worker_protocol.rs` checks an answer spoken under its id and both judgements against
the real Python worker with a fake brain.