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

# Text to Speech

> Convert text into natural-sounding Arabic and English speech with Hamsa TTS

Hamsa Text to Speech (TTS) converts written text into natural-sounding audio with proper Arabic pronunciation, intonation, and support for multiple dialects. Whether you're creating media content, building voice applications, or making content accessible, Hamsa TTS delivers high-quality Arabic speech synthesis.

## Overview

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Technical API documentation for developers
  </Card>

  <Card title="Quickstart" icon="rocket" href="/text-to-speech/quickstart">
    Get started with TTS in minutes
  </Card>
</CardGroup>

## Key features

### Arabic dialect support

Hamsa TTS supports a wide range of Arabic dialects:

* **Multiple dialects**: Egyptian, Gulf, Levantine, Iraqi, and Modern Standard Arabic
* **Natural pronunciation**: Proper handling of Arabic phonetics and pronunciation rules
* **Code-switching**: Handling of mixed Arabic-English text
* **Diacritical marks**: Support for tashkeel and proper pronunciation

### High-quality voices

* Pre-built Arabic voices optimized for different dialects
* Custom [voice cloning](/text-to-speech/voice-cloning) for brand consistency
* Gender and age variety

### Flexible integration

* **REST API** for programmatic access — both [async jobs](/api-reference/endpoint/generate-tts) and [realtime](/api-reference/endpoint/rt-generate-tts)
* **WebSocket** for [streaming TTS](/websocket/websocket-tts)
* **Media Platform** [web interface](/media/text-to-speech/overview)

## API endpoints

Hamsa provides two TTS endpoints for different use cases:

<CardGroup cols={2}>
  <Card title="Jobs API" icon="clock">
    **Async — `/v1/jobs/text-to-speech`**

    Initiates a TTS job and delivers the result via webhook. Best for batch processing and media content generation.

    Parameters: `text`, `voiceId`, `webhookUrl`
  </Card>

  <Card title="Realtime API" icon="bolt">
    **Sync — `/v1/realtime/tts`**

    Returns WAV audio directly in the response. Best for real-time voice agents and interactive applications.

    Parameters: `text`, `speaker`, `dialect`, `mulaw`
  </Card>
</CardGroup>

## Supported dialects

| Code    | Dialect                | Example voices |
| ------- | ---------------------- | -------------- |
| `pls`   | Palestinian            | Amjad, Layan   |
| `egy`   | Egyptian               | Mariam, Samir  |
| `syr`   | Syrian                 | Dalal, Mais    |
| `irq`   | Iraqi                  | Lyali, Fatma   |
| `jor`   | Jordanian              | Lana, Jasem    |
| `leb`   | Lebanese               | Carla, Majd    |
| `ksa`   | Saudi                  | Hiba, Fahd     |
| `uae`   | Emirati                | Salma, Dima    |
| `bah`   | Bahraini               | Mazen, Ruba    |
| `qat`   | Qatari                 | Deema, Faisal  |
| `kuw`   | Kuwaiti                | Mai, Hatem     |
| `oma`   | Omani                  | Aisha, Jaber   |
| `msa`   | Modern Standard Arabic | Salem, Tamim   |
| `ar-sa` | Arabic – Gulf          | Khalid, Rahma  |
| `en`    | English                | Emma, James    |

## Getting started

<Steps>
  <Step title="Choose your integration">
    Use the [Realtime API](/text-to-speech/quickstart#realtime-tts-synchronous) for direct audio, the [Jobs API](/text-to-speech/quickstart#jobs-api-async) for async processing, or the [Media Platform](/media/text-to-speech/overview) web interface.
  </Step>

  <Step title="Select a voice and dialect">
    Choose a voice and dialect that matches your target audience from the table above.
  </Step>

  <Step title="Generate audio">
    Call the API with your text and voice selection. See the [Quickstart](/text-to-speech/quickstart) for examples.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart Guide" icon="rocket" href="/text-to-speech/quickstart">
    Build your first TTS integration
  </Card>

  <Card title="Voice Options" icon="microphone" href="/text-to-speech/voices">
    Explore available voices
  </Card>

  <Card title="Voice Cloning" icon="clone" href="/text-to-speech/voice-cloning">
    Learn about custom voice cloning
  </Card>

  <Card title="Media Platform" icon="play" href="/media/text-to-speech/overview">
    Use TTS via web interface
  </Card>
</CardGroup>

## FAQ

<AccordionGroup>
  <Accordion title="What's the difference between the Jobs API and Realtime API?">
    The Jobs API (`/v1/jobs/text-to-speech`) is async — it creates a job and delivers the audio via webhook. Use it for batch processing. The Realtime API (`/v1/realtime/tts`) returns WAV audio directly in the response — use it for real-time applications and voice agents.
  </Accordion>

  <Accordion title="Can I mix Arabic and English in the same text?">
    Yes, Hamsa TTS handles code-switching between Arabic and English.
  </Accordion>

  <Accordion title="How do I choose the right dialect?">
    Choose the dialect that matches your target audience. Egyptian Arabic has wide recognition across the Arab world. Gulf dialects are preferred in GCC countries. Levantine is common in the Levant region. For formal content, use Modern Standard Arabic (MSA).
  </Accordion>

  <Accordion title="Can I clone my own voice?">
    Yes, Hamsa supports custom voice cloning. See the [voice cloning guide](/text-to-speech/voice-cloning) for details.
  </Accordion>

  <Accordion title="What audio format does the API return?">
    The Realtime API returns WAV audio by default. You can enable μ-law encoding via the `mulaw` parameter for telephony use cases.
  </Accordion>
</AccordionGroup>
