curl --request POST \
--url https://api.tryhamsa.com/v1/realtime/connector/tts-stream \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "مرحبا، كيف يمكنني مساعدتك اليوم؟",
"voiceId": "078338c4-7788-4371-95d4-1bbe45021113",
"sampleRate": "8k"
}
'"<string>"{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}Real Time Routes
Connector TTS Stream
Streams speech for text in a voice picked by ID, as a WAV stream (header, then 16-bit PCM mono). Built for TTS connectors such as Genesys: the speaker, language and dialect come from the voice. Use voice IDs from GET /v2/tts/voices/catalog.
POST
/
v1
/
realtime
/
connector
/
tts-stream
curl --request POST \
--url https://api.tryhamsa.com/v1/realtime/connector/tts-stream \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "مرحبا، كيف يمكنني مساعدتك اليوم؟",
"voiceId": "078338c4-7788-4371-95d4-1bbe45021113",
"sampleRate": "8k"
}
'"<string>"{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}Authorizations
Body
application/json
Text to speak, 1-2,000 characters.
Required string length:
1 - 2000Example:
"مرحبا، كيف يمكنني مساعدتك اليوم؟"
Deprecated. Still accepted (0 to 2, default 1) so existing requests keep working; don't build on it. For emotion and casual delivery, use the v3 connector route and its emotion and casual fields.
Required range:
0 <= x <= 2Example:
1
Response
WAV audio stream (chunked).
The response is of type file.
Was this page helpful?