> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Vartaloop Text-to-Speech

> Hinglish and Indian-language TTS with VartaloopTTSService over WebSocket and VartaloopHttpTTSService over HTTP, streamed per sentence.

> [!NOTE]
>
> **Community-maintained integration.** This service is built and
> maintained by
> [Vartaloop](https://github.com/vartalaap-si)
> . Pipecat does not test or officially support it. Please report issues and
> request changes on the
> [source repository](https://github.com/vartalaap-si/pipecat-vartaloop)
> . Learn more about
> [community integrations](https://docs.pipecat.ai/api-reference/server/services/community-integrations.md)
> .

## Overview

`VartaloopTTSService` generates Hinglish and Indian-language speech from
[Vartaloop](https://vartaloop.ai) over one WebSocket per session, sending each
sentence as its own utterance as soon as it is aggregated.
`VartaloopHttpTTSService` does the same with one HTTP request per sentence.

> [card] [Source Repository](https://github.com/vartalaap-si/pipecat-vartaloop)
>
> Source code, tests, and issues for the Vartaloop integration

> [card] [Example](https://github.com/vartalaap-si/pipecat-vartaloop/blob/main/examples/voice-vartaloop.py)
>
> A Hinglish voice agent using `VartaloopTTSService`

> [card] [Vartaloop Docs](https://docs.vartaloop.ai)
>
> Voices, text normalisation, and the API reference

## Installation

This is a community-maintained package distributed separately from `pipecat-ai`:

```bash theme={null}
uv add "pipecat-vartaloop @ git+https://github.com/vartalaap-si/pipecat-vartaloop.git@v0.1.0"
```

## Prerequisites

1. **Vartaloop account**: sign up at [tts.vartaloop.ai](https://tts.vartaloop.ai).
2. **API key**: create one in the portal.

### Required Environment Variables

* `VARTALOOP_API_KEY`: your Vartaloop API key

## Configuration

### VartaloopTTSService

**api\_key** `str | None` (default: None)

Vartaloop API key. When `None`, it is read from `VARTALOOP_API_KEY`. Raises
`ValueError` when neither is set.

**url** `str` (default: wss\://api.vartaloop.ai/v1/tts/stream)

WebSocket endpoint.

**sample\_rate** `int | None` (default: None)

Output sample rate in Hz. When `None`, the pipeline's rate is used. The API
produces 24 kHz audio, which is resampled when the rates differ.

**settings** `VartaloopTTSService.Settings | None` (default: None)

Runtime-configurable settings. See [Settings](#settings).

### VartaloopHttpTTSService

Takes `api_key`, `sample_rate`, and `settings` as above, plus:

**aiohttp\_session** `aiohttp.ClientSession | None` (default: None)

HTTP session to reuse. When `None`, the service creates one.

**base\_url** `str` (default: [https://api.vartaloop.ai](https://api.vartaloop.ai))

API base URL.

### Settings

Both services take `VartaloopTTSService.Settings`. Every field can be changed
with `TTSUpdateSettingsFrame` and applies from the next sentence, without
reconnecting.

| Field | Type | Default | Description |
| - | - | - | - |
| `voice` | `str` | `"saanvi"` | Voice id. The voice sets the language. See the [Vartaloop docs](https://docs.vartaloop.ai) for the voice list. |
| `expression` | `str` | `"neutral"` | Delivery: `"neutral"`, `"excited"`, `"sad"`, or `"whisper"`. A voice without the expression plays neutral. Alias: `style`. |
| `digits` | `str` | `"auto"` | How digits are read in Hinglish text: `"auto"`, `"hi"` (Hindi number words), `"mixed"` (codes in English, amounts in Hindi), or `"en"`. |
| `speed` | `float \| None` | `None` | Speaking pace from 0.5 to 2.0, pitch preserved. `None` keeps the voice's own pace. Alias: `pace`. |
| `temperature` | `float \| None` | `None` | Sampling temperature from 0 to 2. `None` uses the server default. |
| `seed` | `int \| None` | `None` | Fixed sampling seed for reproducible audio. |
| `postfx` | `bool \| None` | `None` | Server-side loudness normalisation, high-pass, and limiter. `None` uses the server default. |
| `profile` | `str \| None` | `None` | `"default"` or `"telephony"`, which shapes audio for 8 kHz phone calls. |
| `raw` | `bool` | `False` | Skip the server's text normaliser, for text that is already normalised. |

## Usage

### Speak in a Voice Agent

Add the service to a pipeline after the LLM:

```python theme={null}
import os

from pipecat.pipeline.pipeline import Pipeline
from pipecat_vartaloop import VartaloopTTSService

tts = VartaloopTTSService(
    api_key=os.getenv("VARTALOOP_API_KEY"),
    settings=VartaloopTTSService.Settings(voice="saanvi", digits="mixed"),
)

pipeline = Pipeline(
    [
        transport.input(),
        stt,
        user_aggregator,
        llm,
        tts,
        transport.output(),
        assistant_aggregator,
    ]
)
```

### Change the Expression Mid-Call

Push a `TTSUpdateSettingsFrame`:

```python theme={null}
from pipecat.frames.frames import TTSUpdateSettingsFrame

await task.queue_frame(
    TTSUpdateSettingsFrame(
        delta=VartaloopTTSService.Settings(expression="excited")
    )
)
```

## Notes

* **Interruptions**: `VartaloopTTSService` drops the interrupted turn's audio
  and reopens its WebSocket, so the server stops synthesising it. Use it for
  conversational agents, and `VartaloopHttpTTSService` for pipelines without
  interruptions.
* **Compatibility**: tested with Pipecat 1.15.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.