Speech to speech: mute/unmute independent from voice state#5794
Open
pranavjoshi001 wants to merge 1 commit intomicrosoft:mainfrom
Open
Speech to speech: mute/unmute independent from voice state#5794pranavjoshi001 wants to merge 1 commit intomicrosoft:mainfrom
pranavjoshi001 wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors Speech-to-Speech (S2S) mute handling by decoupling “muted” from the voiceState state machine and tracking it as a separate client-controlled flag.
Changes:
- Add
microphoneMutedto the core voice reducer state and remove'muted'from theVoiceStateunion. - Update S2S recording bridge and hook (
useVoiceRecordingMuted) to usemicrophoneMutedinstead of deriving mute fromvoiceState. - Update the HTML2 S2S mute/unmute integration test to validate the new behavior and reset-on-stop semantics.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/reducers/voiceActivity.ts | Introduces microphoneMuted state and updates mute/unmute/stop transitions. |
| packages/core/src/actions/setVoiceState.ts | Removes 'muted' from the VoiceState type. |
| packages/api/src/providers/SpeechToSpeech/private/VoiceRecorderBridge.tsx | Switches mute source to useVoiceRecordingMuted and reorders effects. |
| packages/api/src/hooks/useVoiceRecordingMuted.ts | Uses voice.microphoneMuted selector and documents new semantics. |
| tests/html2/speechToSpeech/mute.unmute.html | Updates integration assertions to track microphoneMuted separately from voiceState. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/api/src/providers/SpeechToSpeech/private/VoiceRecorderBridge.tsx
Show resolved
Hide resolved
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.
Description
This PR enhances the mute/unmute functionality for Speech-to-Speech (S2S) by separating
microphoneMuted, making mute a client-side control independent of the agent state machine.Problem
Previously,
mutedwas part of thevoiceStateenum (idle' | 'listening' | 'muted' | ...), which caused issues:Detach it from voice state machine would fix all above.
CHANGELOG.mdReview Checklist
z-index)package.jsonandpackage-lock.jsonreviewed