Messages
WebSocket Playgrounds
Text-to-Speech
Convert text to streaming audio via WebSocket
WSS
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.
Connect to the WebSocket and send TTS requests to convert text into streaming audio.
Quick Start
- Enter your API key in the authentication field
- Click Connect to establish the WebSocket connection
- Modify the request payload with your text
- Click Send to receive streaming audio
Request Message
After connecting, send a JSON message with the following structure:Must be
"tts"TTS Request
Response Sequence
The server responds with:1. Acknowledgment
2. Binary Audio Chunks
3. Stream End
Dialects and Voice Examples
Pick aspeaker that matches your chosen dialect. Voice examples per dialect:
| Dialect | Code | Voice examples |
|---|---|---|
| Palestinian | pls | Amjad, Layan |
| Egyptian | egy | Mariam, Samir |
| Syrian | syr | Dalal, Mais |
| Iraqi | irq | Lyali, Fatma |
| Jordanian | jor | Lana, Jasem |
| Lebanese | leb | Carla, Majd |
| Saudi | ksa | Hiba, Fahd |
| Emirati | uae | Salma, Dima |
| Bahraini | bah | Mazen, Ruba |
| Qatari | qat | Deema, Faisal |
| Kuwaiti | kuw | Mai, Hatem |
| Omani | oma | Aisha, Jaber |
| MSA / Fusha | msa | Salem, Tamim |
| Arabic – Gulf | ar-sa | Khalid, Rahma |
| English | en | Emma, James |
Available Speakers
Refer to Hamsa Platforms to get the list of the available pre-built speakers where you can take the name of the speaker, or use a UUID for your custom cloned voice.Using Custom Cloned Voices
When using a custom cloned voice (UUID) as the speaker, you must preload the voice before establishing the WebSocket connection. This ensures optimal latency during streaming.Messages