simli-ai
package:
"YOUR_SIMLI_API_KEY"
with your actual Simli API key, and "YOUR_FACE_ID"
with the desired face ID for your application.
apiKey
: str. Your API key you get from [https://app.simli.com/profile]faceId
: str # FaceID you can get from [https://docs.simli.com/api-reference/available-faces] or create your own on [https://app.simli.com]syncAudio
: bool. Specify whether your want to receive the audio back (Leave true if unsure)handleSilence
: bool. Specify whether you want to keep the Simli Avatar Moving when you don’t send in AudiomaxSessionLength
: int. A hard time limit (in seconds) after which the session will disconnectmaxIdleTime
: int. A soft time limit (in seconds) that disconnects the session after a period of not sending in dataclass SimlClient(config: SimliConfig, useTurnServer: bool = False, latencyInterval: int = 60)
async def Initialize()
: Initializes the SimliClient with the provided configuration and starts the WebRTC Connectionasync close()
: Closes the WebRTC connection and cleans up resources.async send(data: bytes | string)
: Sends audio data or control signals to the server.async sedSilence(duration: float= 0.1875)
: Sends the specified duration to the server as silent audio, used mostly in Idle mode.async clearBuffer()
: Clears the audio buffer, best used when you want the avatar to stop talking.async getNextVideoFrame()
: returns the following PyAV VideoFrame.async getNextAudioFrame()
: returns the following PyAV AudioFrame.async getVideoStreamIterator(targetFormat:str)
: Creates an async iterator that retrieves all the video frames in order. Can be used in an async for
loop.
targetFormat
: specify what format you want the frames to be in, defaults to RGB.async getAudioStreamIterator(targetSampleRate)
: Creates an async iterator that retrieves all the video frames in order. Can be used in an async for
loop.
targetSampleRate: int
: specify the sampling rate of the output audio, specify if you want to use the audio in something else that has specific sampling rate constraints