A simple real-time Text-to-Speech client for the XDERA TTS API.
This repository provides minimal reference implementations showing how to connect to the API, stream generated audio, and play it immediately with very low latency.
The project is designed to be straightforward and easy to understand so developers can quickly experiment with real-time speech synthesis or integrate the API into their own applications.
You can obtain a free API key through the community Discord server.
Join the server, Look for an API Key on the #Announcement channel, and you will be able to use the examples in this repository.
This repository demonstrates how to:
- Send text requests to the TTS API
- Receive audio as a continuous stream
- Play synthesized speech in real time
- Display a basic audio visualization during playback
Both a browser-based interface and a Python example are included to demonstrate different ways of interacting with the service.
web_example/
Basic browser client for sending text and playing streamed audio
example.py
Python command-line example for streaming and playing generated speech
requirements.txt
Dependency list required for the Python example
To run the examples you will need:
- A valid API key
- Python 3.9 or newer (for the Python client)
- A modern web browser (for the web interface)
Clone the repository:
git clone https://github.com/XDERA-Network/XDERA-TTS-Client.git
cd XDERA-TTS-Client- Open the
web_exampledirectory. - Edit the file
script.js. - Locate the API key configuration near the top of the file:
const API_Flavour = "[ENTER_YOUR_API_KEY_HERE!]";- Replace the placeholder with your API key.
- Open
index.htmlin your browser. - Enter text and generate audio.
The page will request speech from the API and start playing the stream as soon as audio data begins arriving.
Install the required dependencies:
pip install -r requirements.txtOpen example.py and find the header configuration:
headers = {"x-api-key": "[ENTER_YOUR_API_KEY_HERE!]"}Replace the placeholder with your API key.
Run the script:
python example.pyThe program will send a request to the API, receive the audio stream, and play it in real time while displaying a simple terminal visualization.
This repository serves as a minimal reference client for the XDERA TTS API.
The implementation is intentionally simple so the streaming flow can be easily understood and adapted for other applications.