Skip to content

✨ say.tone: play the listening chime on Discord - #51

Merged
clubanderson merged 1 commit into
mainfrom
tone-discord
Nov 18, 2026
Merged

clubanderson merged 1 commit into
mainfrom
tone-discord

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #50

Discord had no listening tone, so say.tone always answered played:false there. Now:

  • src/tone.ts renders the chime in code, the same design as the Vexa bot's (G5 then C6, 100 ms each, 8 ms attack, 25 ms release, decay, peak 18% of full scale, 24 kHz mono). No assets. It is about 200 ms long, matching the bot so Betty chimes alike everywhere.
  • DiscordAdapter.tone() upsamples it to 48 kHz stereo and plays it through the same player and Opus path as speech. It returns at once and plays asynchronously, so hive's 2 second timeout is never an issue.
  • Dropped (played:false) when a say is queued or playing, when a tone is already playing, when there is no TTS (no player, the bot has no voice) or when the bot is not in the channel. A say that starts during the chime stops it first, so speech is never delayed. Never throws.
  • Tests: generator (length, peak bound, silent edges, determinism, two pitches) and the adapter with the fake voice connection (plays once, dropped while speaking, cut by a say, no voice, not connected, player failure).
  • docs/contract.md and README updated; version 0.6.0 (release tag needed for hive to pick it up).

Only the companion still has no tone (hivecommons/quorum-companion#12).

🤖 Generated with Claude Code

The Discord adapter renders the same two-note chime as the Vexa bot (src/tone.ts) and plays it into the voice channel at once, without waiting. It is dropped when a line is queued or playing, when one is already playing or when the bot has no voice, a say cuts it, and it never throws.

Fixes #50

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@clubanderson
clubanderson merged commit bcb35f4 into main Nov 18, 2026
7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the tone-discord branch November 18, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ say.tone: play the listening chime on Discord

1 participant