Skip to content

feat: show who the bot hears speaking while recording - #63

Merged
ChristopherPHolder merged 5 commits into
mainfrom
f/issue-54-speaking-ring-f177ad
Oct 30, 2026
Merged

ChristopherPHolder merged 5 commits into
mainfrom
f/issue-54-speaking-ring-f177ad

Conversation

@ChristopherPHolder

Copy link
Copy Markdown
Collaborator

What and why

While a recording runs, the "In the office" list now rings the avatar of whoever the bot hears speaking, so a mic that isn't getting through shows up straight away instead of as a gap in the transcript.

  • VoiceCapture emits StartedSpeaking/StoppedSpeaking from the receiver's start and end events alongside the clips. The Recorder counts someone as speaking until 2 seconds after end (Speaking.ts), so a sentence with short pauses is one flip. Clips are saved on their own fiber, so a slow upload doesn't hold the speaking state back.
  • Each occupant in office.recording_status.occupants gets speaking, and Occupant in recording-requests/wire gets speaking: boolean. The gateway's own list is now OfficeMember (without the flag). Rows written before this change read as not speaking, so the Activity keeps working until the bot writes a new status.
  • The status goes through a single writer that writes at most once a second, and only when it changed. While anyone shows as speaking it rechecks every second so the ring clears when the hold runs out. When the capture ends (stop, reconnect or failure), everyone is cleared.
  • PbAvatar has a speaking input that draws the ring, and Person has an optional speaking that PbPeople passes on.
  • The Office Recorder polls the status every second while a recording runs and every 3 seconds otherwise. Each poll now waits for the previous one to finish.

When nothing is recorded, the bot stays deafened, nobody is speaking, and the list looks the same as before.

Closes #54

How I tested it

  • Speaking.test.ts covers the 2-second hold, short pauses and separate speakers.
  • Recorder.test.ts covers the status write throttle (a change waits for the next second), the hold running out, and nobody speaking once the recording stops.
  • RecordingRequests.test.ts covers the speaking flag round trip and reading old rows without it.
  • office-store.spec.ts covers the switch between the 1-second and 3-second polls. The avatar and people specs cover the ring.
  • I haven't tried it against a real Discord server yet.

Checklist

  • vp run ci passes
  • Tests cover the change
  • README updated if what gets posted, the configuration or the deploy changed (nothing to update)
  • New environment variables are wired through (none)
  • Ready to ship: merging this deploys it to production

VoiceCapture now reports when someone starts and stops speaking, and the
Recorder counts them as speaking until 2 seconds after they stop. Each
occupant in the recording status carries a speaking flag, the status is
written at most once a second, and the Office Recorder rings the avatar
of whoever is speaking, polling every second while a recording runs.

Closes #54
…ing-f177ad

# Conflicts:
#	apps/office-recorder/src/app/recorder/office-store.spec.ts
#	apps/office-recorder/src/app/recorder/office-store.ts
…ing-f177ad

# Conflicts:
#	apps/bot/src/DiscordGateway.ts
#	apps/bot/test/Recorder.test.ts
…ing-f177ad

# Conflicts:
#	apps/bot/test/Recorder.test.ts
@ChristopherPHolder
ChristopherPHolder merged commit 9c52f87 into main Oct 30, 2026
2 checks passed
@ChristopherPHolder
ChristopherPHolder deleted the f/issue-54-speaking-ring-f177ad branch October 30, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show who the bot hears speaking in the Office Recorder while recording

1 participant