Stream Speech
curl --request POST \
--url https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech \
--header 'Content-Type: application/json' \
--header 'x-bot: <api-key>' \
--header 'x-user-auth: <api-key>' \
--data '
{
"TextMessage": "مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي",
"LanguageCode": "ar",
"Speaker": "Hesham",
"ModelType": "v1",
"StreamChunkSize": 300
}
'import requests
url = "https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech"
payload = {
"TextMessage": "مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي",
"LanguageCode": "ar",
"Speaker": "Hesham",
"ModelType": "v1",
"StreamChunkSize": 300
}
headers = {
"x-user-auth": "<api-key>",
"x-bot": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-auth': '<api-key>',
'x-bot': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
TextMessage: 'مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي',
LanguageCode: 'ar',
Speaker: 'Hesham',
ModelType: 'v1',
StreamChunkSize: 300
})
};
fetch('https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'TextMessage' => 'مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي',
'LanguageCode' => 'ar',
'Speaker' => 'Hesham',
'ModelType' => 'v1',
'StreamChunkSize' => 300
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-bot: <api-key>",
"x-user-auth: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech"
payload := strings.NewReader("{\n \"TextMessage\": \"مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي\",\n \"LanguageCode\": \"ar\",\n \"Speaker\": \"Hesham\",\n \"ModelType\": \"v1\",\n \"StreamChunkSize\": 300\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-auth", "<api-key>")
req.Header.Add("x-bot", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech")
.header("x-user-auth", "<api-key>")
.header("x-bot", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"TextMessage\": \"مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي\",\n \"LanguageCode\": \"ar\",\n \"Speaker\": \"Hesham\",\n \"ModelType\": \"v1\",\n \"StreamChunkSize\": 300\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-auth"] = '<api-key>'
request["x-bot"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"TextMessage\": \"مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي\",\n \"LanguageCode\": \"ar\",\n \"Speaker\": \"Hesham\",\n \"ModelType\": \"v1\",\n \"StreamChunkSize\": 300\n}"
response = http.request(request)
puts response.read_bodydata: {"chunk_id": 1, "audio_data": "UklGRl4AAABXQVZFZm10...", "chunk_size": 1024}
data: {"chunk_id": 2, "audio_data": "VFJBVEVZRjQAAABXQVZF...", "chunk_size": 1024}
data: {"chunk_id": 3, "audio_data": "ZGF0YQQ=", "chunk_size": 512}
data: {"status": "complete", "total_chunks": 3, "total_duration": 4.2, "consumption": "58/15000"}
Stream Speech
Real-time text to speech conversion with audio streaming for immediate playback.
Key Features:
- Real-time audio generation
- Progressive audio chunks
- Lower latency for long texts
- Streaming audio playback
Use Cases:
- Live voice assistants
- Real-time narration
- Interactive voice applications
- Immediate audio feedback
Audio Format: MP3 chunks delivered via server-sent events
Note: Example requests/responses shown here are illustrative. When using the live “Try it” tool, you may see two responses: an HTTP status preview and the API’s streaming output.
POST
/
api
/
v2
/
AQL
/
Stream
/
TextToSpeech
Stream Speech
curl --request POST \
--url https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech \
--header 'Content-Type: application/json' \
--header 'x-bot: <api-key>' \
--header 'x-user-auth: <api-key>' \
--data '
{
"TextMessage": "مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي",
"LanguageCode": "ar",
"Speaker": "Hesham",
"ModelType": "v1",
"StreamChunkSize": 300
}
'import requests
url = "https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech"
payload = {
"TextMessage": "مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي",
"LanguageCode": "ar",
"Speaker": "Hesham",
"ModelType": "v1",
"StreamChunkSize": 300
}
headers = {
"x-user-auth": "<api-key>",
"x-bot": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-auth': '<api-key>',
'x-bot': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
TextMessage: 'مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي',
LanguageCode: 'ar',
Speaker: 'Hesham',
ModelType: 'v1',
StreamChunkSize: 300
})
};
fetch('https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'TextMessage' => 'مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي',
'LanguageCode' => 'ar',
'Speaker' => 'Hesham',
'ModelType' => 'v1',
'StreamChunkSize' => 300
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-bot: <api-key>",
"x-user-auth: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech"
payload := strings.NewReader("{\n \"TextMessage\": \"مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي\",\n \"LanguageCode\": \"ar\",\n \"Speaker\": \"Hesham\",\n \"ModelType\": \"v1\",\n \"StreamChunkSize\": 300\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-auth", "<api-key>")
req.Header.Add("x-bot", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech")
.header("x-user-auth", "<api-key>")
.header("x-bot", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"TextMessage\": \"مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي\",\n \"LanguageCode\": \"ar\",\n \"Speaker\": \"Hesham\",\n \"ModelType\": \"v1\",\n \"StreamChunkSize\": 300\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.widebot.net/api/v2/AQL/Stream/TextToSpeech")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-auth"] = '<api-key>'
request["x-bot"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"TextMessage\": \"مرحباً! هذا مثال على التحويل الصوتي المباشر للنص العربي\",\n \"LanguageCode\": \"ar\",\n \"Speaker\": \"Hesham\",\n \"ModelType\": \"v1\",\n \"StreamChunkSize\": 300\n}"
response = http.request(request)
puts response.read_bodydata: {"chunk_id": 1, "audio_data": "UklGRl4AAABXQVZFZm10...", "chunk_size": 1024}
data: {"chunk_id": 2, "audio_data": "VFJBVEVZRjQAAABXQVZF...", "chunk_size": 1024}
data: {"chunk_id": 3, "audio_data": "ZGF0YQQ=", "chunk_size": 512}
data: {"status": "complete", "total_chunks": 3, "total_duration": 4.2, "consumption": "58/15000"}
Authorizations
Body
application/json
Text to convert to speech
Example:
"مرحباً! هذا بث صوتي لحظي."
Response
200 - text/event-stream
Streaming audio generation with progressive chunks
Server-sent events with audio chunks
Was this page helpful?

