Duck Spotify volume while speaking instead of talking over it - #10
Merged
Conversation
The extension already paused YouTube while VoxClaw spoke, but Spotify web playback was left at full volume, so speech competed with music. Fade playing open.spotify.com tabs down to 20% for the duration of the speech and restore each tab's original volume afterward. Restore is held 1.5s because /status reports reading:false during the speech queue's 1s inter-item gap; without the hold, volume yo-yos between queued utterances. Volume is also restored if the listener disappears or polling is turned off, so tabs are never left stuck quiet. Verified on Spotify's real DOM: the player is a media element in the main document (readyState 4), so querySelectorAll reaches it without shadow-DOM traversal. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Jul 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The extension already paused YouTube while VoxClaw spoke, but Spotify web playback was left at full volume, so speech competed with the music. This fades playing
open.spotify.comtabs down to 20% for the duration of the speech, then restores each tab's original volume (300ms down, 500ms up). YouTube's pause/resume behavior is unchanged.Notes
RESTORE_HOLD_MS)./statusreportsreading:falseduring the speech queue's 1s inter-item gap, so without the hold the volume yo-yos between queued utterances.element.volume— the dip is visible in the UI, not just audible.service_worker.js.Verification
requestAnimationFrameclock: ducks to exactly 0.2, restores to the original 0.85, and skips elements already quieter than the duck level.shallow=1, deep=1, readyState=4), soquerySelectorAll("video, audio")reaches it with no shadow-DOM traversal./statusat a steady 1Hz against a running VoxClaw.!media.pausedgate, i.e. ducking during actual playback.🤖 Generated with Claude Code