Skip to main content
POST
/
v2
/
tts
/
voices
/
preview
Preview TTS voice
curl --request POST \
  --url https://api.tryhamsa.com/v2/tts/voices/preview \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "audioUrl": "https://cdn.tryhamsa.com/uploads/voice.wav",
  "audioTranscription": "مرحباً، هذا مثال على التسجيل الصوتي.",
  "language": "ar",
  "dialectId": "145a7af6-3614-4bb2-be5d-702000d459ab",
  "text": "أهلاً بك، هذا مثال لنطق الصوت."
}
'
{
  "success": true,
  "message": "Operation completed successfully",
  "messageKey": "OPERATION_SUCCESSFUL",
  "data": {
    "audioUrl": "https://cdn.tryhamsa.com/previews/preview.wav"
  }
}

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.

Authorizations

Authorization
string
header
required

Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '

Query Parameters

projectId
string
required

Project identifier.

Example:

"ae6d58c6-c6bd-4ae0-ad74-b8b39c29928b"

Body

application/json
audioUrl
string<uri>
required

URL of the uploaded voice sample

Example:

"https://cdn.tryhamsa.com/uploads/voice.wav"

audioTranscription
string
required

Transcription of the uploaded audio sample

Required string length: 1 - 5000
Example:

"مرحباً، هذا مثال على التسجيل الصوتي."

language
enum<string>
required

Language of the preview voice

Available options:
en,
ar
Example:

"ar"

dialectId
string<uuid>
required

Dialect identifier (required for preview)

Example:

"145a7af6-3614-4bb2-be5d-702000d459ab"

text
string
required

Text to be synthesized using the preview voice

Required string length: 1 - 5000
Example:

"أهلاً بك، هذا مثال لنطق الصوت."

Response

Preview generated successfully.

success
boolean
Example:

true

message
string
Example:

"Operation completed successfully"

messageKey
string
Example:

"OPERATION_SUCCESSFUL"

data
object