Repository navigation
fix(studio): play preview audio at speeds above 1x - #2691
Merged
Merged
Conversation
The player force-muted preview audio whenever playback rate exceeded 1x and disabled the mute button (and the M shortcut) in that state. Users changing speed to 2x heard nothing, and clicking unmute did nothing. Media elements play audio fine at any rate (pitch preserved by default), so remove the special case: audio now follows only the user's mute toggle at every speed. Drops the shouldMutePreviewAudio helper and the audioAutoMuted UI/keyboard gating that existed solely for it.
useTimelinePlayer.seek.test.ts still asserted the old force-mute: at 2x
with the user unmuted it expected a set-muted{muted:true} message. With
audio now following only the user's toggle, the preview receives
set-muted{muted:false}. Update the assertion and title to match.
dahans-msft2
pushed a commit
to dahans-msft2/hyperframes
that referenced
this pull request
Aug 6, 2026
* fix(studio): play preview audio at speeds above 1x
The player force-muted preview audio whenever playback rate exceeded 1x
and disabled the mute button (and the M shortcut) in that state. Users
changing speed to 2x heard nothing, and clicking unmute did nothing.
Media elements play audio fine at any rate (pitch preserved by default),
so remove the special case: audio now follows only the user's mute
toggle at every speed. Drops the shouldMutePreviewAudio helper and the
audioAutoMuted UI/keyboard gating that existed solely for it.
* test(studio): update seek audio test for unmuted-above-1x behavior
useTimelinePlayer.seek.test.ts still asserted the old force-mute: at 2x
with the user unmuted it expected a set-muted{muted:true} message. With
audio now following only the user's toggle, the preview receives
set-muted{muted:false}. Update the assertion and title to match.
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.
Problem
In the studio player, changing playback speed above 1x (e.g. 2x) silently killed preview audio, and the mute button did nothing — clicking it, or pressing M, had no effect. Reported by a user: "when I change playback speed, the audio does not play" … "nothing happens when I click on [the volume icon]."
Root cause
shouldMutePreviewAudio(audioMuted, playbackRate)returnedtruewheneverplaybackRate > 1, force-muting the preview regardless of the user's mute state. The mute button and the M shortcut were both disabled/gated in that same state (audioAutoMuted = playbackRate > 1), so there was no way to get audio back without dropping to ≤1x.There is no technical reason for this: media elements play audio fine at any rate (pitch is preserved by default), and the runtime already scales
el.playbackRatefor every active media clip.Fix
Remove the "mute above 1x" special case entirely — preview audio now follows only the user's mute toggle at every speed.
shouldMutePreviewAudioand its re-export.audioAutoMuted/effectiveAudioMutedUI machinery inPlayerControls(button is enabled and toggles at any speed).playbackRate <= 1gate on the M shortcut.applyPreviewAudioStateno longer takes a now-meaningless rate override.Net -45 lines.
Verification
tsc --noEmitonpackages/studio: clean.PlayerControls.test.tsandusePlaybackKeyboard.test.ts: pass (the latter now asserts M toggles at 2x; both stale "mute above 1x" tests updated).