Skip to main content
WSS
answer
type:object

RTC Answer as generated by https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/createAnswer or compatible. Will be received AFTER an offer has been sent

camera_notice
type:string

Server replies to a camera message, sent as text. None of them end the session.

asset_notice
type:string

Server replies to a background or foreground message, sent as text; a message that is applied gets none. None of them end the session, and the avatar keeps what it had.

event
type:string

Server sent signals

error
type:string

Termination messages that specify the reason for immediate termination, including a routing error (Routing error, no EU Sessions available. EU ONLY PROCESSING enabled) when a region-pinned session lands on a machine outside its region

offer
type:object
audio_chunk
type:string

Binary stream of the audio that the Avatar will lipsync to. Sent as a binary stream (in JS/TS UInt8Arr)

clear_buffer
type:string

Client Signal to make the avatar stop speaking immediately and ignore all previously sent audio

final_message
type:string

Client Signal to tell the server that the final segment of audio has been already sent and that it should close after playing it back

camera
type:string

Moves the camera, Trinity-2 faces only. Sent as binary: the ASCII prefix CAM_, then little-endian float32 camera offsets on top of the avatar's own framing, in this order (y comes before x):

Send the first 4, the first 7 or all 9 values; the ones left off stay neutral (0).

Each message replaces the whole camera, including the one the session started with (the session token's camera): the values are offsets from the avatar's own framing, not from the previous message. 0, 0, 0, 1, 0, 0, 0, 0, 0 returns to the avatar's own framing.

The camera cuts to the new setting. To glide instead, append the ASCII tag LERP and one more float32: the seconds the move takes, from wherever the camera is now (part-way through an earlier glide, if one is running). 0 or less is a cut.

A message is 20, 32 or 40 bytes, or 28, 40 or 48 with LERP. A value outside its supported range is still applied, with a WARNING: reply. Any other length, NaN or infinity is rejected and the camera stays where it is. See camera_notice.

background
type:string

Puts one of your uploaded backgrounds behind the avatar, Trinity-2 faces only: the ASCII prefix BG_ and the background's id, as POST /assets/backgrounds returned it, 36 characters (hyphens included, either case). Text or binary; 39 characters in all, nothing else is accepted. An image can't be sent: upload it first. The background is cropped to fill the session's canvas.

Only your own backgrounds: an id that isn't one of your account's is ignored. It replaces the one the session started with (the session token's background_id) a moment later, once loaded; audio keeps playing meanwhile, and the last one sent wins. See asset_notice.

BG_00000000-0000-0000-0000-000000000000 (the nil UUID) goes back to the avatar's own background, at once.

foreground
type:string

Lays one of your uploaded foregrounds over the avatar through its transparency, Trinity-2 faces only: the ASCII prefix FG_ and the foreground's id, as POST /assets/foregrounds returned it, 36 characters. Text or binary; 39 characters in all, nothing else is accepted, an image least of all. Otherwise as background, in place of the session token's foreground_id. FG_00000000-0000-0000-0000-000000000000 (the nil UUID) takes the foreground away.