> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# Sarvam

## Classes

* [RealtimeTTSPlayer](/api-reference/voxengine/sarvam/realtime-tts-player)

## Functions

### createRealtimeTTSPlayer

Creates a new [Sarvam.RealtimeTTSPlayer](/api-reference/voxengine/sarvam/realtime-tts-player) 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.

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

**Parameters**

**`text`** `string` — required

---

**`parameters`** `RealtimeTTSPlayerParameters`

---

## Types

### RealtimeTTSPlayerParameters

*Extends:* `_WebSocketBasedClientParameters`

[Sarvam.RealtimeTTSPlayer](/api-reference/voxengine/sarvam/realtime-tts-player) 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](https://docs.sarvam.ai/api-reference/text-to-speech/stream#send.Configure-Connection).

---

#### 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.

---