Skip to navigation

Sarvam

Sarvam streaming text-to-speech integration. Add the following line to your scenario code to use the namespace: require(Modules.Sarvam);

View as Markdown

Classes

Functions

createRealtimeTTSPlayer

Creates a new Sarvam.RealtimeTTSPlayer instance with the specified text (TTS is used to play the text). You can attach media streams later via the Sarvam.RealtimeTTSPlayer.sendMediaTo or VoxEngine.sendMediaBetween methods.

The player opens with a config message. The text is sent next, as a separate text message. Call Sarvam.RealtimeTTSPlayer.flush to finish the utterance.

createRealtimeTTSPlayer(text: string, parameters?: RealtimeTTSPlayerParameters): RealtimeTTSPlayer

Parameters

text
stringRequired
parameters
RealtimeTTSPlayerParameters

Types

RealtimeTTSPlayerParameters

Extends: _WebSocketBasedClientParameters

Sarvam.RealtimeTTSPlayer parameters. Can be passed as arguments to the Sarvam.createRealtimeTTSPlayer method.

apiKey
string

optional

Optional. Sarvam API key (api-subscription-key). Use your Sarvam API key if you have your own Sarvam account.

configParameters
Object

optional

Optional. Object to provide parameters directly to the Sarvam provider Configure Connection message. Find more information in the documentation.

Inherited fields

privacy
boolean

_optional, inherited from WebSocketBasedClientParameters

Optional. Whether to enable the privacy functionality.

If privacy is enabled, the logging for the WebSocket connection is disabled.

NOTE: the default value is false.

statistics
boolean

_optional, inherited from WebSocketBasedClientParameters

Optional. Enables statistics functionality.

trace
boolean

_optional, inherited from WebSocketBasedClientParameters

Optional. Whether to enable the tracing functionality.

If tracing is enabled, a URL to the trace file appears in the ‘websocket.created’ message. The file contains all sent and received WebSocket messages in the plain text format. The file is uploaded to the S3 storage.

NOTE: enable this only for diagnostic purposes. You can provide the trace file to our support team to help investigate issues.