Websockets

VTS P.O.G. have websockets running on localhost, they are used by png pets and to show the captions we provide as part of the program. They provide data about tts running, mouth shapes and much more. They are quite useful! You can connect to the webscoekt at localhost:3800

ws://localhost:3800/api

You will be mainly receiving from it “events” in json format. Here is a list of the expected events you can receive.

Subscribe to events #

Once connected to the websocket, you need to do a small “handshake” to subscribe to the events by sending the following payload to it

{ “type”: “client”, “data”: “shake” }

 

Events #

TTS starts #

Triggeres when a new tts audio starts to play. It triggers the moment the audio starts playing.

{

“type”:”startTTS”,

“data”:

{

“text”:”pog online poggers”,

“user”:”VTS-POG”,

“source”:”manual”,

“priority”:6,

“charLimit”:888,

“id”:0,

“curatedText”:”pog online poggers”

}

}

user = the user that triggered the TTS, if send by writing in VTS P.O.G. either by the floating keyboard or testing, it will arrive as “VTS-POG”.

source = what triggered the tts

priority = queue priority, currently deprecated.

charLimit = char limit of the redeem if any

id = id of current redeem internally on the program. Goes from 0 and up in 1 each time a new redeem is unqueed from the tts queue.

text = original text of the redeem before being filtered by banwords.

curatedText = text after being filtered by the banwords list.

Mouth #

Triggered each tick when mouth shapes are calculated and sent to the model. Given we use the websockets for some of the alternative ways to connect to some pet types, this carries over the mouth data we use for the pest’s mouth shape calculations.

{

“type”:”mouth”,

“data”:

{

“form”:0.96,

“open”:0.414

}

}

 

Updated on April 24, 2024