Realtime API client
The Realtime API client connects to the Inworld Realtime WebSocket API. It supports bidirectional audio streaming, text transcriptions, conversation items, and model responses.
Usage
- Require the
Modules.Inworldmodule in your VoxEngine scenario. - Create an
Inworld.RealtimeAPIClientinstance viaInworld.createRealtimeAPIClientand provide your parameters. - Send media between a
Call(or another media unit) and the client via*.sendMediaTo,*.sendMedia, orVoxEngine.sendMediaBetween. - Send Realtime API commands via the client methods (
sessionUpdate,responseCreate, and others). Find payload formats in the Inworld Realtime WebSocket API documentation. - Listen to
Inworld.RealtimeAPIEventsandInworld.Events, then implement your application logic.
Here is the complete scenario example for your reference:
Inworld Realtime API client
Inworld Realtime TTS Player
Inworld.createRealtimeTTSPlayer provides text-to-speech over WebSocket using the Inworld TTS WebSocket API.
See the Realtime speech synthesis article for usage and a scenario example.