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

@@ -414,6 +414,13 @@ impl DiscordCore {
Some(id)
}
/// Play the earcon in the voice channel, queued like speech. The request id, or None when not in a
/// voice channel.
pub fn earcon(&self) -> Option<String> {
self.voice_channel_id()?;
Some(with_playback(&self.inner, |p| p.clip(crate::earcon::pcm().to_vec())))
}
/// Have the brain answer a chat message under `id`; the text comes as `CoreEvent::ReplyText`.
pub fn chat_answer(&self, id: &str, user: u64, text: &str) -> bool {
self.inner.worker.reply(id, user, text, "chat", false)