Skip to content

AvatarKit v1.3.1

Choose a tag to compare

@WRZ-hash WRZ-hash released this 07 Aug 09:11
· 4 commits to main since this release

Rolls up everything from the 1.3.1 beta line.

Added

  • Opus audio support. AudioFormat.inputAudioFormat (.pcm default, or .opus) declares the format the host feeds into the SDK via send/yieldAudioData; .opus input is decoded back to PCM16 for local rendering and forwarded upstream as-is in direct mode. AudioFormat.opusBitrate tunes 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 .direct or .host as 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(_:) and generateTransitionToFrameSync(...). They behave like their async counterparts but have no suspension points, so consecutive frames keep their call order. The async versions 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. Pass opusUplinkEnabled: false to keep the raw PCM uplink. Unchanged for host mode (no uplink) and for .opus input (already compressed). If the configured sampleRate is 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 region configuration 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 configured region continues to take precedence.
  • initialize with a missing appID now 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 audioFormat parameter of AvatarController.yieldAudioData is gone; the signature is now yieldAudioData(_:end:). The audio format is taken from Configuration.audioFormat passed to AvatarSDK.initialize, which is also what the inputAudioFormat setting requires. Host-mode callers that passed a per-call format must drop the argument and set the format at initialization instead.