Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/livekit/client-sdk-swift/llms.txt

Use this file to discover all available pages before exploring further.

Configuration options for capturing camera video and microphone audio.

CameraCaptureOptions

Options for configuring camera capture.

Properties

deviceType
AVCaptureDevice.DeviceType?
default:"nil"
Preferred device type to use (e.g., .builtInWideAngleCamera, .builtInUltraWideCamera).If device is specified, it will be used instead.
This property is not available on visionOS.
device
AVCaptureDevice?
default:"nil"
Exact device to use for camera capture. When set, this takes precedence over deviceType.
position
AVCaptureDevice.Position
default:".unspecified"
Preferred camera position such as .front or .back.
preferredFormat
AVCaptureDevice.Format?
default:"nil"
Specific camera format to use.
dimensions
Dimensions
default:".h720_169"
Preferred dimensions for capturing. The SDK may override with a recommended value.
fps
Int
default:"30"
Preferred frames per second for capturing. The SDK may override with a recommended value.

Usage

let cameraOptions = CameraCaptureOptions(
    position: .front,
    dimensions: .h1080_169,
    fps: 30
)

let track = LocalVideoTrack.createCameraTrack(options: cameraOptions)
try await room.localParticipant.publish(videoTrack: track)

AudioCaptureOptions

Options for configuring audio capture with WebRTC’s software processing.
On iOS devices, Apple’s Voice-Processing I/O is enabled by default. On simulators, WebRTC’s voice processing is used instead since Apple’s Voice-Processing I/O is not available.

Properties

echoCancellation
Bool
default:"platform-dependent"
Enable software (WebRTC’s) echo cancellation.Defaults:
  • iOS/macOS devices: false (Apple’s voice processing is used)
  • Simulator: true (WebRTC’s processing is used)
See AudioManager.isVoiceProcessingBypassed for details.
autoGainControl
Bool
default:"platform-dependent"
Enable software (WebRTC’s) auto gain control.Defaults:
  • iOS/macOS devices: false (Apple’s gain control is used)
  • Simulator: true (WebRTC’s processing is used)
See AudioManager.isVoiceProcessingAGCEnabled for details.
noiseSuppression
Bool
default:"platform-dependent"
Enable noise suppression.Defaults:
  • iOS/macOS devices: false
  • Simulator: true
highpassFilter
Bool
default:"false"
Enable highpass filter to remove low-frequency noise.
typingNoiseDetection
Bool
default:"false"
Enable typing noise detection and suppression.

Presets

noProcessing
AudioCaptureOptions
Preset with all processing disabled.
AudioCaptureOptions(
    echoCancellation: false,
    autoGainControl: false,
    noiseSuppression: false,
    highpassFilter: false,
    typingNoiseDetection: false
)

Usage

// Use default processing
let audioOptions = AudioCaptureOptions()

// Disable all processing
let noProcessing = AudioCaptureOptions.noProcessing

// Custom configuration
let customOptions = AudioCaptureOptions(
    echoCancellation: true,
    noiseSuppression: true
)

let track = LocalAudioTrack.createTrack(options: customOptions)
try await room.localParticipant.publish(audioTrack: track)