Skip to content

fix(studio): play preview audio at speeds above 1x - #2691

Merged
miguel-heygen merged 2 commits into
mainfrom
fix/studio-audio-mute-above-1x
Jul 21, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
fix/studio-audio-mute-above-1x

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

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) returned true whenever playbackRate > 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.playbackRate for 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.

  • Delete shouldMutePreviewAudio and its re-export.
  • Drop the audioAutoMuted / effectiveAudioMuted UI machinery in PlayerControls (button is enabled and toggles at any speed).
  • Remove the playbackRate <= 1 gate on the M shortcut.
  • applyPreviewAudioState no longer takes a now-meaningless rate override.

Net -45 lines.

Verification

  • tsc --noEmit on packages/studio: clean.
  • PlayerControls.test.ts and usePlaybackKeyboard.test.ts: pass (the latter now asserts M toggles at 2x; both stale "mute above 1x" tests updated).
  • Pre-commit hooks (lint, format, fallow audit, typecheck, commitlint): all green.

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.
@miguel-heygen
miguel-heygen merged commit 07965e9 into main Jul 21, 2026
40 checks passed
@miguel-heygen
miguel-heygen deleted the fix/studio-audio-mute-above-1x branch July 21, 2026 12:32
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.
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