Advanced features

View as Markdown

Beyond the core audio controls, the Video SDK for macOS offers several advanced audio features.

Select an audio device

Desktop setups often have several microphones and speakers attached. Enumerate them with getMicList and getSpeakerList, then activate one with selectMic or selectSpeaker.

let audioHelper = ZMVideoSDK.shared()?.getAudioHelper()

// Enumerate devices.
let micList = audioHelper?.getMicList()
let speakerList = audioHelper?.getSpeakerList()

// Activate a specific device by ID and name.
audioHelper?.selectMic("micDeviceID", deviceName: "micDeviceName")
audioHelper?.selectSpeaker("speakerDeviceID", deviceName: "speakerDeviceName")

Subscribe to raw audio data

To access raw audio frames, subscribe through the ZMVideoSDKAudioHelper. After subscribing, the SDK delivers audio frames to your delegate's raw-data callbacks.

let audioHelper = ZMVideoSDK.shared()?.getAudioHelper()
audioHelper?.subscribe()
// When you no longer need raw audio:
audioHelper?.unSubscribe()

For the raw audio callbacks and how to process mixed, per-user, and shared audio, see Receive raw data.