SMeetingEngine. They don’t require being in a meeting—you can call them once logged in. For usage guidance, see Device management.
getDevices(kind:)
Enumerates system devices.
Returns:
[DeviceInfo]; doesn’t throw.
Platform differences:
- On macOS, the audio lists include a virtual device that points to the system default input / output
- On iOS, audio input returns the available input routes (Bluetooth, wired headset, built-in microphone, etc.)
- iOS doesn’t support enumerating audio outputs;
kind: .audioOutputreturns an empty array on iOS
switchMic(deviceId:)
Switches the microphone input.
Returns: None
Throws: An underlying error when switching the device fails.
The behavior adapts to the current state:
setAudioOutput(deviceId:)
Selects the audio output device. macOS only.
Returns: None
Throws: An underlying error when switching the device fails.
setSpeakerOutputEnabled(_:)
Toggles speakerphone. iOS only.
Returns: None
Throws: An underlying error when the setting fails.
This and
setAudioRoute(_:) below are two ways of using the same mechanism—don’t mix them and end up with two sets of state.
Audio routing (iOS)
The following APIs are iOS only and control whether sound comes out of the speaker or the earpiece. These are the only two targets you can switch to—Bluetooth / wired headsets are taken over by the system; for the reason, see Audio routing.defaultAudioRoute
AudioRouteTarget (read-write)
The persistent default output route. It’s most reliable to set it before entering the meeting, and it stays in effect long term. It has lower priority than the temporary override from setAudioRoute(_:).
setAudioRoute(_:)
Temporarily switches the output route during the meeting, with higher priority than
defaultAudioRoute. Doesn’t throw: while an external device (Bluetooth / wired) is in use, switching to .speaker is skipped by the underlying layer and logged—the operation has no effect on iOS in that case anyway. Use currentAudioRoute to check the actual result.
clearAudioRouteOverride()
defaultAudioRoute.
Read-only state
Route changes and recovery from interruptions are reported through
meeting(_:audioRouteDidChange:) and meetingAudioRouteDidRecoverFromInterruption(_:); see Events.
Device events
Device plug and unplug events are reported throughSMeetingDelegate; see Events:
meeting(_:didAddDevice:)meeting(_:didRemoveDevice:)