docs(ios-audio): align activation lifecycle comments

This commit is contained in:
Edison Jwa
2026-06-09 02:16:20 +09:00
parent 7be3934c86
commit 703f44d731
2 changed files with 7 additions and 6 deletions
@@ -46,7 +46,8 @@ import AVFoundation
// //
// VoIP configuration is engaged on voice-channel join via the // VoIP configuration is engaged on voice-channel join via the
// `chanora/ios_audio_session` MethodChannel, driven from Dart // `chanora/ios_audio_session` MethodChannel, driven from Dart
// by the BridgeEvent::AudioStarted / AudioStopped lifecycle. // before `voiceJoin` starts VoiceProcessingIO and again as an
// idempotent guard on the AudioStarted lifecycle.
do { do {
try AVAudioSession.sharedInstance().setCategory(.ambient, mode: .default) try AVAudioSession.sharedInstance().setCategory(.ambient, mode: .default)
logAudioSessionState(context: "launch-ambient") logAudioSessionState(context: "launch-ambient")
@@ -79,8 +80,8 @@ import AVFoundation
} }
/// Activate the VoIP audio session. Called from Dart via the /// Activate the VoIP audio session. Called from Dart via the
/// `chanora/ios_audio_session` channel when a voice channel join /// `chanora/ios_audio_session` channel before a voice channel join
/// reaches the `BridgeEvent::AudioStarted` stage. Configures /// starts VoiceProcessingIO. Configures
/// .playAndRecord + .voiceChat with .mixWithOthers so other apps /// .playAndRecord + .voiceChat with .mixWithOthers so other apps
/// (Spotify, podcasts) can keep playing alongside the voice /// (Spotify, podcasts) can keep playing alongside the voice
/// channel matching the Telegram group-call UX. Idempotent: /// channel matching the Telegram group-call UX. Idempotent:
@@ -10,9 +10,9 @@ const iosAudioSessionChannelName = 'chanora/ios_audio_session';
/// launch and leaves it inactive. The session is only switched to /// launch and leaves it inactive. The session is only switched to
/// `.playAndRecord` + `.voiceChat` (with `.mixWithOthers`) while a /// `.playAndRecord` + `.voiceChat` (with `.mixWithOthers`) while a
/// voice channel is actually active. This controller is the Dart /// voice channel is actually active. This controller is the Dart
/// side of that contract — call [activate] when the Rust engine /// side of that contract — call [activate] before the Rust engine
/// emits `BridgeEvent::AudioStarted` and [deactivate] on /// starts VoiceProcessingIO and [deactivate] on
/// `BridgeEvent::AudioStopped`. /// `BridgeEvent::AudioStopped` or failed joins.
/// ///
/// On non-iOS platforms both methods are no-ops; the platforms /// On non-iOS platforms both methods are no-ops; the platforms
/// handle their own session lifecycle elsewhere (Android via /// handle their own session lifecycle elsewhere (Android via