Rate this page:

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

Copy URL
  1. Require the Modules.Inworld module in your VoxEngine scenario.
  2. Create an Inworld.RealtimeAPIClient instance via Inworld.createRealtimeAPIClient and provide your parameters.
  3. Send media between a Call (or another media unit) and the client via *.sendMediaTo, *.sendMedia, or VoxEngine.sendMediaBetween.
  4. Send Realtime API commands via the client methods (sessionUpdate, responseCreate, and others). Find payload formats in the Inworld Realtime WebSocket API documentation.
  5. Listen to Inworld.RealtimeAPIEvents and Inworld.Events, then implement your application logic.

Here is the complete scenario example for your reference:

Inworld Realtime API client

Inworld Realtime TTS Player

Copy URL

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.

Rate this page: