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

@@ -243,6 +243,7 @@ fn parse_call(raw: &Map<String, Value>, wake_words: &[String], d: &CallSettings)
designated_no_wake_word: get_bool(call, "designatedNoWakeWord", "call", d.designated_no_wake_word)?,
stop_words,
follow_up: get_ms(call, "followUpMs", "call", d.follow_up, 5000)?,
earcon: get_bool(call, "earcon", "call", d.earcon)?,
},
chat_wake_words,
))
@@ -478,7 +479,7 @@ mod tests {
"voice": {"wakeWords": ["자비스", "javis"]},
"call": {"similarity": 0.3, "mode": "addressed", "designated": [ID], "designatedOnly": true,
"designatedNoWakeWord": true, "stopWords": ["멈춰", " "], "chatWakeWords": ["봇"],
"followUpMs": 2500},
"followUpMs": 2500, "earcon": false},
"response": {"policy": "important", "queueMax": 3, "collectMs": 500, "settleMs": 0,
"priorities": {ID: 2}}
})).unwrap();
@@ -490,6 +491,8 @@ mod tests {
assert_eq!(s.call.stop_words, vec!["멈춰"]);
assert_eq!(s.chat_wake_words, Some(vec!["봇".to_string()]));
assert_eq!(s.call.follow_up, Duration::from_millis(2500));
assert!(!s.call.earcon);
assert!(parse_settings(&json!({})).unwrap().call.earcon, "on by default");
assert_eq!(s.response.kind, PolicyKind::Important);
assert_eq!(s.response.queue_max, 3);
assert_eq!(s.response.collect, Duration::from_millis(500));
@@ -503,6 +506,7 @@ mod tests {
(json!({"call": {"mode": "sometimes"}}), "call.mode"),
(json!({"call": {"designated": ["1"]}}), "call.designated"),
(json!({"call": {"followUpMs": 6000}}), "call.followUpMs"),
(json!({"call": {"earcon": "yes"}}), "call.earcon"),
(json!({"response": {"policy": "random"}}), "response.policy"),
(json!({"response": {"queueMax": 0}}), "response.queueMax"),
(json!({"response": {"collectMs": 5000}}), "response.collectMs"),