Skip to content

fix: bypass voice processing only for stereo#25

Merged
santhoshvai merged 2 commits intomasterfrom
adm-sync
Feb 4, 2026
Merged

fix: bypass voice processing only for stereo#25
santhoshvai merged 2 commits intomasterfrom
adm-sync

Conversation

@santhoshvai
Copy link
Member

@santhoshvai santhoshvai commented Feb 3, 2026

ref: GetStream/stream-video-swift#1009

Summary by CodeRabbit

  • New Features

    • Consolidated default audio constraints so tracks use sensible defaults while still honoring user-specified audio settings
  • Bug Fixes

    • Voice processing no longer forcibly bypassed by default
    • Stereo playout preference now correctly aligns with voice processing bypass state
  • Chores

    • Updated copyright year to 2026

@santhoshvai santhoshvai self-assigned this Feb 3, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Updates to iOS WebRTC audio handling and media-stream defaults: AudioDeviceModule.swift adjusts copyright year, changes source string formatting, removes automatic voice-processing bypass on init, and ties VP bypass to stereo playout preference; WebRTCModule+RTCMediaStream.m adds a new commonOptionalConstraints method and centralizes default audio constraint handling.

Changes

Cohort / File(s) Summary
Audio Device Configuration
ios/RCTWebRTC/Utils/AudioDeviceModule/AudioDeviceModule.swift
Bumped copyright year (2025→2026); configureInputFromSource prints source directly; removed default forced voice-processing bypass during initialization; apply voice-processing bypass state when stereo playout preference is set (source.isVoiceProcessingBypassed = isPreferred).
Media Stream Constraints
ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m
Added + (NSDictionary *)commonOptionalConstraints to centralize default RTC optional constraints; createAudioTrack now uses these defaults and only overrides with user-specified audio constraint keys (e.g., autoGainControl, noiseSuppression, echoCancellation, highpassFilter).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped through lines of audio code,
Tweaked bypasses where echoes strode.
Defaults gathered, sources named,
2026 stamped and proudly framed.
Softly now the streams will flow. 🎧

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: bypass voice processing only for stereo' accurately captures the main change in AudioDeviceModule.swift where voice processing bypass is now conditionally applied only when stereo playout is enabled, making it directly relevant to the primary modification.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch adm-sync

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Failure to add the new IP will result in interrupted reviews.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m (1)

54-56: ⚠️ Potential issue | 🟠 Major

User-provided false constraints are converted to true.

convertBoolToString: uses object truthiness, so @NO becomes "true". That means users cannot disable autoGainControl, noiseSuppression, echoCancellation, or highpassFilter once defaults are set. This breaks constraint overrides.

🛠️ Suggested fix
- (NSString *)convertBoolToString:(id)value {
-    return value ? @"true" : @"false";
-}
+ (NSString *)convertBoolToString:(id)value {
+    if (value == nil || value == (id)kCFNull) {
+        return kRTCMediaConstraintsValueFalse;
+    }
+    if ([value respondsToSelector:`@selector`(boolValue)]) {
+        return [value boolValue] ? kRTCMediaConstraintsValueTrue : kRTCMediaConstraintsValueFalse;
+    }
+    return kRTCMediaConstraintsValueFalse;
+}

Also applies to: 72-83

@santhoshvai santhoshvai merged commit d7b9b3a into master Feb 4, 2026
4 checks passed
@santhoshvai santhoshvai deleted the adm-sync branch February 4, 2026 13:01
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.

2 participants