Configure the audio session from the resolved voice processing state - #1086
Draft
hiroshihorie wants to merge 5 commits into
Draft
Configure the audio session from the resolved voice processing state#1086hiroshihorie wants to merge 5 commits into
hiroshihorie wants to merge 5 commits into
Conversation
webrtc-sdk PR 275 added isVoiceProcessingEnabled to the delegate method, so frameworks built past 144.7559.11 fail protocol conformance without this. The parameter is ignored for now, exposing it through AudioEngineObserver is a separate API addition.
…state The willEnableEngine delegate callback carries the resolved state since 144.7559.12 (webrtc-sdk PR 275), so the adapter hands it to the session observer before the observer chain runs and the whole Swift-side prediction is deleted: updateExpectedPlatformVoiceProcessing with its simulator special case, the calls in setRecordingAlwaysPreparedMode and startLocalRecording, the LocalAudioTrack.setAudioProcessingOptions push, and AudioProcessingOptions.requestsPlatformEchoNoisePath with its tests. This is the simplification planned in #1072. The direct push in setPlatformVoiceProcessingAllowed(false) stays, since VPIO teardown there happens without an engine transition, so no callback would fire to update the session. The observer state is renamed from isPlatformVoiceProcessingExpected to isPlatformVoiceProcessingActive to match the resolved semantics.
hiroshihorie
marked this pull request as ready for review
August 14, 2026 06:51
…ession-mode # Conflicts: # LiveKitClient.podspec # Package.swift # Package@swift-6.2.swift # Sources/LiveKit/Audio/AudioDeviceModuleDelegateAdapter.swift
pblazej
approved these changes
Aug 17, 2026
hiroshihorie
marked this pull request as draft
August 18, 2026 09:10
Member
Author
|
Converting to draft for now, the delivery logic here may change (mid-capture VP toggles don't re-fire |
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.
willEnableEnginenow carriesisVoiceProcessingEnabled(webrtc-sdk/webrtc#275, shipped since144.7559.12). The adapter hands it toAudioSessionEngineObserverbefore the observer chain runs, so the session mode is always configured from the state the ADM actually resolved, never a Swift-side guess. This is the simplification planned in #1072.Deleted with that:
updateExpectedPlatformVoiceProcessingincluding its simulator special case and therequestsPlatformEchoNoisePath && isPlatformVoiceProcessingAllowedmirror of the ADM's resolution, its call sites insetRecordingAlwaysPreparedMode,startLocalRecording, andLocalAudioTrack.setAudioProcessingOptions, andAudioProcessingOptions.requestsPlatformEchoNoisePathwith its tests. Net -80 lines.Kept: the direct push in
setPlatformVoiceProcessingAllowed(false), since VPIO teardown there happens without an engine transition, so no callback would fire to update the session. The observer state is renamed fromisPlatformVoiceProcessingExpectedtoisPlatformVoiceProcessingActiveto match the resolved semantics.No public API changes. Passing the state through the public
AudioEngineObserverchain was deliberately deferred: adding a parameter toengineWillEnablebreaks existing conformers, and a defaulted overload silently drops the value whenever a chain contains an old-style observer. A context-struct redesign is the right public evolution if consumers need the state.