Skip to content

Don't pause Sonos when a Teams call starts - #109

Merged
RichKelsey merged 1 commit into
mainfrom
fix/teams-call-pause
Oct 15, 2026
Merged

RichKelsey merged 1 commit into
mainfrom
fix/teams-call-pause

Conversation

@RichKelsey

Copy link
Copy Markdown
Contributor

Problem

When you join a Teams call, Teams pauses every Windows media session (SMTC). The native SMTC addon sent that pause straight to Sonos, so one person joining a call paused the office speakers for everyone.

Fix

The pause event doesn't say who sent it, so "another app has the microphone open" is used as the call signal (read from the Windows CapabilityAccessManager consent store, the same data behind the taskbar mic indicator):

  • Mic already open when the pause arrives: pause is ignored.
  • Mic not open: pause goes through immediately (media keys / volume flyout unchanged). If the mic opens within 4s, playback is resumed. This covers Teams sending the pause before it opens the mic.
  • Both cases log to the console and send a SmtcPauseIgnored telemetry event.

Only the SMTC path is gated. The in-app pause button and taskbar thumbnail buttons are unaffected.

Trade-offs

  • While on any call, a media-key or flyout pause won't pause Sonos.
  • Pausing deliberately and then joining a call within 4s will resume the music.

Testing

  • Unit tests for parsing the reg query output: node --test src/mic-in-use.test.ts
  • tsc and ESLint pass.
  • Not yet tested in a real Teams call.

🤖 Generated with Claude Code

Teams pauses every SMTC media session on joining a call, which paused the
office speakers for everyone. SMTC pause commands are now ignored while
another app has the microphone open, and if the mic opens within 4s of a
pause we resume playback. Normal media-key/flyout pauses stay instant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 70.57% 2144 / 3038
🔵 Statements 67.5% 2457 / 3640
🔵 Functions 61.69% 678 / 1099
🔵 Branches 62.47% 2308 / 3694
File CoverageNo changed files found.
Generated in workflow #159 for commit 8a770c4 by the Vitest Coverage Report Action

@RichKelsey
RichKelsey merged commit 4eb41fc into main Oct 15, 2026
3 checks passed
RichKelsey added a commit that referenced this pull request Oct 15, 2026
…110)

The mic-in-use check from #109 didn't stop the pauses: Bluetooth headsets
send pause when they connect, switch to call mode or come off, which
doesn't line up with the mic opening. Windows can't tell those apart from
a deliberate media-key pause, so pause commands from SMTC and Chromium's
media session are now ignored on Windows. Play, next and previous still
work, and pausing from the app and its taskbar buttons is unchanged.

Removes the now-unused mic-in-use module.

Co-authored-by: Richard Kelsey <rkelsey@truenorthit.co.uk>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant