Simli
Video service for generating AI avatar responses using Simli’s WebRTC API
Overview
SimliVideoService
creates AI avatar video responses by converting audio input into synchronized video and audio output through Simli’s WebRTC platform. It handles real-time audio streaming, video generation, and automatic audio resampling.
Installation
Install the required dependencies:
Configuration
Required Environment Variables
Get your API key and Face ID by signing up at Simli
Configuration
Constructor Parameters for SimliConfig
Your Simli API key. This key is required for authenticating API requests.
The face identifier for Simli. This is used to associate API interactions with a specific face or persona.
Indicates whether to synchronize audio streams. Defaults to True
. Set to
False
to disable audio synchronization.
Determines if silence in audio streams should be handled automatically.
Defaults to True
.
The maximum length of a session in seconds. Defaults to 600
(10 minutes).
The maximum idle time (in seconds) allowed during a session before it is
automatically terminated. Defaults to 30
seconds.
Constructor Parameters for SimliVideoService
The configuration object for Simli. This must be an instance of simli_config
and contains essential settings such as API key, face ID, and other
session-related configurations.
Determines whether a TURN server should be used for establishing connections.
Defaults to False
. Set to True
if your network requires TURN for WebRTC
connections.
Delay (in seconds) between ping calls to calculate latency between your
machine and simli server. Set to 0
to disable.
Input Frames
Audio Input
Raw audio data for avatar speech
Control Frames
Signals start of speech synthesis
Signals end of speech synthesis
Signals conversation interruption
Signals end of conversation
Signals conversation cancellation
Usage Example
Frame Flow
Metrics Support
The service collects processing metrics:
- Processing duration
- Time to First Byte (TTFB)
- API response times
- Audio processing metrics
Common Use Cases
-
AI Video Avatars
- Virtual assistants
- Customer service
- Educational content
-
Interactive Presentations
- Product demonstrations
- Training materials
- Marketing content
-
Real-time Communication
- Video conferencing
- Virtual meetings
- Interactive broadcasts
Notes
- Handles real-time audio streaming
- Supports conversation interruptions
- Manages conversation lifecycle
- Automatic audio resampling
- Thread-safe processing
- WebRTC integration through Daily
- Includes comprehensive error handling