AvatarKit v1.3.1
Rolls up everything from the 1.3.1 beta line.
Added
-
Opus audio support.
AudioFormat.inputAudioFormat(.pcmdefault, or.opus) declares the format the host feeds into the SDK viasend/yieldAudioData;.opusinput is decoded back to PCM16 for local rendering and forwarded upstream as-is in direct mode.AudioFormat.opusBitratetunes the target bitrate. Only effective in direct mode. -
DrivingServiceMode.rtc. Only for integrations that drive the avatar through the companion RTC SDK — if you are not using that package, keep.director.hostas before. It is a reporting dimension and unlocks no API: RTC drives the avatar frame by frame through the existing rendering entry points, so runtime behaviour is unchanged either way..package(url: "https://github.com/spatius-ai/avatarkit-ios-rtc.git", exact: "1.0.0-beta.6")
Integration guide: https://docs.spatius.ai/
-
Synchronous rendering entry points on
AvatarView, for callers driven by an external frame clock:renderFrameSync(_:startIdle:),renderFromProtobufSync(_:)andgenerateTransitionToFrameSync(...). They behave like theirasynccounterparts but have no suspension points, so consecutive frames keep their call order. Theasyncversions remain available and unchanged.
Changed
- The direct-mode uplink now compresses audio to Opus by default (
AudioFormat.opusUplinkEnabled, previously off). It cuts the upload to roughly 1/8 at the cost of client-side encoding, which matters most on the mobile networks where stalls actually happen. PassopusUplinkEnabled: falseto keep the raw PCM uplink. Unchanged for host mode (no uplink) and for.opusinput (already compressed). If the configuredsampleRateis not one of Opus's supported rates, the SDK logs a warning and falls back to raw PCM. - Opus uplink encoding now streams: each second of audio is sent as soon as it is encoded, instead of waiting for the whole chunk to finish. When a host hands over a long utterance in one call, the first packet used to wait out the entire encode; playback now starts noticeably sooner.
- The
regionconfiguration now defaults to automatic selection: when left unset, the SDK picks the closest serving region at initialization. With nothing cached yet the first launch waits for the lookup; afterwards the cached region is used right away and refreshed in the background, taking effect on the next launch. An explicitly configuredregioncontinues to take precedence. initializewith a missingappIDnow fails fast instead of returning silently, matching Android. The accompanying message points to https://app.spatius.ai/ to obtain an app ID.
Fixed
- Idle animation no longer stops while the first animation frames of a round are still in flight, which could leave the avatar visibly frozen at the start of playback.
- In
region: auto, the socket URL is now built per connection, so a session started before region resolution settled connects to the resolved region instead of the fallback one. - The warning logged when animation falls behind audio now states what happened and what to do about it (feed audio at roughly twice real time), instead of the previous message that gave neither.
Removed
- Breaking: the per-call
audioFormatparameter ofAvatarController.yieldAudioDatais gone; the signature is nowyieldAudioData(_:end:). The audio format is taken fromConfiguration.audioFormatpassed toAvatarSDK.initialize, which is also what theinputAudioFormatsetting requires. Host-mode callers that passed a per-call format must drop the argument and set the format at initialization instead.