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.
Testing the Audio Mute State Preservation Fix
This document describes how to test the fix for the issue where audio mute state was not preserved when switching input devices.
Issue Description
Problem: When a call was muted using
call.muteAudio()
, the audio track'senabled
flag was set tofalse
. However, whencall.setAudioInDevice()
was invoked to switch the input device, a new audio track was created without preserving theenabled = false
state, causing the previously muted call to become unmuted.Fix: Modified
setAudioInDevice()
andsetVideoDevice()
methods inpackages/common/src/webrtc/BaseCall.ts
to preserve theenabled
state from the old track when creating a new track.Final Implementation
The fix was implemented in commit
1c8cea0
and includes:Core Changes in BaseCall.ts
1. Enhanced
setAudioInDevice()
method:2. Enhanced
setVideoDevice()
method:Testing Options
There are two ways to test this fix:
Option 1: Flask Automated Test App (Recommended)
A comprehensive Flask application was created specifically for testing this fix with automated test sequences.
Location:
packages/js/examples/flask-mute-test/
Features:
Quick Setup:
Then navigate to
http://localhost:3000
and follow the automated test instructions.Option 2: Manual Testing with Vanilla Example
Location:
packages/js/examples/vanilla-calling/
Setup:
Navigate to
https://localhost:9000
for manual testing.Detailed Test Procedures
Prerequisites
Automated Test Sequence (Flask App)
The Flask app runs the following automated tests:
muteAudio()
and verifies mute stateunmuteAudio()
and verifies unmute stateManual Test Steps
Connect to SignalWire
Make a Call
Test Audio Mute State Preservation
Step 3a: Basic Mute Test
Step 3b: Device Switch Test (The Fix)
Step 3c: Unmute Test
Test Video Mute State Preservation (if video enabled)
Expected Results
✅ Success Criteria (Fix Working)
track.enabled
matches expected state❌ Failure Indicators (Fix Broken)
track.enabled
doesn't match expected stateTechnical Details
How the Fix Works
enabled
statenewTrack.enabled = oldTrack.enabled
Key Code Changes
The fix adds these critical lines to both
setAudioInDevice()
andsetVideoDevice()
:Files Modified
packages/common/src/webrtc/BaseCall.ts
- Core fix implementationpackages/js/examples/flask-mute-test/
- Complete automated test suiteapp.py
- Flask server with JWT generationtemplates/index.html
- Test interface with automationbuild-and-copy-sdk.sh
- SDK build scriptrequirements.txt
- Python dependenciesREADME.md
- Detailed setup instructionsBrowser Compatibility
Tested and working in:
Troubleshooting
Common Issues
Debug Commands
Console Debugging
Development Workflow
To test changes to the SDK:
packages/common/src/
npm run setup js
or use Flask app'sbuild-and-copy-sdk.sh
Commit Information
1c8cea0
- "Fix for issue 559"mute_fix
This fix ensures that the mute state is properly preserved when switching input devices, resolving the issue where previously muted calls would become unmuted after device changes.