Skip to content

Conversation

@hiroshihorie
Copy link
Member

@hiroshihorie hiroshihorie commented Jan 13, 2026

Updated lib to 137.7151.12 which includes patch webrtc-sdk/webrtc#212

Reference: https://developer.apple.com/videos/play/wwdc2023/10235/?time=197

All the audio streams other than the voice audio stream from your app are considered as "other audio" by Apple's voice processing

Summary by CodeRabbit

  • Documentation

    • Added comprehensive guide explaining audio ducking behavior and configuration controls.
  • Changed

    • Updated default audio ducking configuration.
  • Chores

    • Bumped dependency versions.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link

github-actions bot commented Jan 13, 2026

⚠️ This PR does not contain any files in the .changes directory.

@hiroshihorie hiroshihorie changed the title Change default other audio ducking configuration Change default other-audio-ducking configuration Jan 13, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

This PR updates the LiveKit iOS SDK to support advanced audio ducking capabilities by bumping the WebRTC dependency version across multiple manifest files, adding documentation explaining the ducking behavior, and refactoring the audio ducking implementation to use internal type conversion adapters instead of explicit raw value assignments.

Changes

Cohort / File(s) Summary
Changelog & Documentation
.changes/other-audio-ducking, Docs/audio.md
Added changelog entry marking configuration change as "changed". Added new "Other audio ducking" documentation section explaining Apple voice processing behavior, SDK defaults (false), and public controls with usage examples.
Dependency Updates
LiveKitClient.podspec, Package.swift, Package@swift-6.0.swift
Bumped LiveKitWebRTC dependency from 137.7151.10 to 137.7151.12 across all manifest files. Added new OrderedCollections dependency (v1.1.4) to podspec.
Audio Ducking Implementation
Sources/LiveKit/Audio/Manager/AudioManager.swift, Sources/LiveKit/Types/AudioDuckingLevel.swift
Refactored AudioDuckingLevel enum to remove explicit raw value assignments and introduced internal type conversion adapters (toRTCType(), toLKType()). Updated AudioManager getter/setter to use these conversion methods and enhanced documentation comments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A hop toward clearer ducking,
With conversions now in place,
Raw values tucked away so neat,
Type adapters set the pace!
WebRTC bumped, docs expanded wide,
Audio flows with proper pride. 🎵

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating the default other-audio-ducking configuration by bumping the WebRTC dependency version and adding documentation/implementation support.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

@davidzhao
Copy link
Member

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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)
LiveKitClient.podspec (1)

17-21: Typo: Extra leading space in version constraint.

Line 21 has " = 1.1.4" (with a leading space) while line 20 uses "= 1.1.4". This inconsistency may cause CocoaPods to fail dependency resolution.

🔧 Proposed fix
-  spec.dependency("OrderedCollections", " = 1.1.4")
+  spec.dependency("OrderedCollections", "= 1.1.4")
🧹 Nitpick comments (1)
Sources/LiveKit/Types/AudioDuckingLevel.swift (1)

26-33: Consider explicitly defining raw values for defensive API stability.

While the current codebase doesn't rely on rawValue or init(rawValue:) (conversion uses case matching instead), explicitly assigning values protects against silent breaking changes if clients—or future SDK changes—rely on raw value persistence:

Optional refactor to preserve explicit raw values
 public enum AudioDuckingLevel: Int {
-    case `default`
-    case min
-    case mid
-    case max
+    case `default` = 0
+    case min = 1
+    case mid = 2
+    case max = 3
 }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d6f3aa and 5327825.

📒 Files selected for processing (7)
  • .changes/other-audio-ducking
  • Docs/audio.md
  • LiveKitClient.podspec
  • Package.swift
  • Package@swift-6.0.swift
  • Sources/LiveKit/Audio/Manager/AudioManager.swift
  • Sources/LiveKit/Types/AudioDuckingLevel.swift
🧰 Additional context used
🧬 Code graph analysis (2)
Sources/LiveKit/Types/AudioDuckingLevel.swift (2)
Sources/LiveKit/Types/AudioSessionConfiguration.swift (1)
  • toRTCType (109-115)
Sources/LiveKit/Types/SpeechActivityEvent.swift (1)
  • toLKType (25-31)
Sources/LiveKit/Audio/Manager/AudioManager.swift (3)
Sources/LiveKit/Types/AudioDuckingLevel.swift (2)
  • toLKType (48-56)
  • toRTCType (37-44)
Sources/LiveKit/Types/AudioEngineAvailability.swift (2)
  • toLKType (33-36)
  • toRTCType (40-43)
Sources/LiveKit/Audio/Manager/AudioManager+ModuleType.swift (1)
  • toRTCType (27-32)
🔇 Additional comments (9)
Package@swift-6.0.swift (1)

23-23: LGTM!

The WebRTC dependency version bump to 137.7151.12 is consistent with the PR objectives and aligns with the changes in Package.swift and LiveKitClient.podspec.

Package.swift (1)

22-22: LGTM!

The WebRTC dependency version bump to 137.7151.12 is consistent across all package manifests.

Docs/audio.md (1)

31-53: Well-documented feature addition.

The documentation clearly explains:

  • Apple's voice processing ducking behavior
  • The SDK's conservative defaults (minimal ducking)
  • Available controls with practical examples

The documented ducking levels (.default, .min, .mid, .max) match the actual AudioDuckingLevel enum cases defined in Sources/LiveKit/Types/AudioDuckingLevel.swift. This aligns well with the PR's goal to document the new default other-audio-ducking configuration.

.changes/other-audio-ducking (1)

1-1: Changelog fragment format is correct.

The format patch type="changed" "message" matches the expected syntax defined in scripts/create_version.swift. The entry will be properly processed to bump the patch version and added to the CHANGELOG under the "### Changed" section.

Sources/LiveKit/Types/AudioDuckingLevel.swift (2)

17-24: Docs clearly define “other audio.”

This clarification should help callers interpret ducking behavior correctly.


36-55: Adapter mapping is clean; please verify enum parity in the updated WebRTC bundle.

The explicit case mapping avoids raw‑value coupling. Please double‑check that LiveKitWebRTC 137.7151.12 still defines .default/.min/.mid/.max so these conversions stay aligned.

Sources/LiveKit/Audio/Manager/AudioManager.swift (3)

219-245: Docs make advanced vs fixed ducking behavior clear.

The defaults and usage guidance are easy to follow.


248-249: Centralized conversion usage looks good.

Using the adapter helpers here keeps the mapping consistent in one place.


315-315: Extra permission note is helpful.

Nice clarification for developers integrating recording flows.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@hiroshihorie hiroshihorie merged commit a6bd781 into main Jan 20, 2026
28 of 32 checks passed
@hiroshihorie hiroshihorie deleted the hiroshi/other-audio-ducking branch January 20, 2026 07:50
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.

4 participants