CXR-L(EN)
CXR-L(EN)
IntroductionQuick StartDevelopment Flow & State-MachineTerms and Abbreviations
Feature Development
Version HistoryAndroid
iOS
cxr-l-sdk · v1.0.1 · snapshot 2026-05-13· ↗ source
Audio
iOS: Audio
Scenario
Support recording, stopping recording, and pushing audio streams to the glasses for playback, and observe link state and data chunks via audioEventPublisher. Unlike Android where you directly startAudioStream to receive PCM, the API shape is different, but the business goal is the same: handle audio data after a session is established.
Prerequisites
- Authentication is complete and the link is ready (see “Connection and Session”).
- The glasses-side scene is built: the Custom View is running on the glasses, or the Custom App has been launched; only then start recording or streaming. Do not call
startRecord/feedAudiowhen only the link is connected and the scene is not ready.
Key APIs (by name)
startRecord(_:codec:mode:)/stopRecord(_:): control recording capture.audioEventPublisher: subscribe to started / stream events for UI and debug logs.
Recommended flow
- Call
startRecordto start capture → subscribe toaudioEventPublisher. - End: call
stopRecord; if streaming was used, callstopPlayAudio. - On page destroy, cancel subscriptions and stop timers to avoid memory leaks.
Development suggestions
- Keep the
typeparameter consistent betweenstartRecordandstopRecord(follow the SDK enums).
Sample entry points (typical)
| Action | Common demo method name |
|---|---|
| Start/stop recording | startRecordTapped / stopRecordTapped |
| Event binding | bindAudioEvents |
Please follow the actual Swift symbols in ios_cxr_l_sample.