User Tools

Site Tools


api:pbx:audio:ttstest

API : PBX : Audio Text to speech - test

Introduction

This request will, based on a voice and text to be spoken by the text-to-speech engine, generate an MP3 audio file and return it. This is primarily to be used for testing a spoken sentence before choosing to use it.

Request

URL https://api.telecomx.dk/pbx/audio/tts/test
Method GET or POST
Access level MANAGER or OWNER if user belongs to the customer the audio shall belong to.
RESELLER if customer belongs to the reseller.
RESELLER_ADMIN or ADMIN.
Property Type Description
Body engine String [optional] Which speech engine to use: ELEVEN_ML, ELEVEN_FLASH, ELEVEN_TURBO, ELEVEN_V3. Limits apply to usage. Defaults to ELEVEN_FLASH.
text String The text to speak, max. 3000 characters.
voice String The voice to speak with - use Voices API to retrieve a list of available voices.
language String [optional] The language of the text in ISO 639-1 format. Only applies to engines: ELEVEN_FLASH and ELEVEN_TURBO. If not set, it will be inferred from the voice.
format String [optional] Format of audio, see format list below. Defaults to MP3.
speed Number [optional] Speaking speed - 70 (slow) → 120 (fast). Defaults to 100 (normal).
stability Number [optional] Randomness in generation, lower = more emotional, higher = more monotonous. 0 → 100, defaults to 50.
similarity Number [optional] How closely to the original should the voice be, 0 → 100, defaults to 75.
style Number [optional] This amplifies the style of the voice, 0 → 100, default to 0.
customer Id [optional] Id of customer doing the streaming. Defaults to users customer.
Engine Description Languages Stream startup
ELEVEN_ML Eleven Labs multilingual V2 29 ~1000ms
ELEVEN_TURBO Eleven Labs turbo V2.5 32 ~500ms
ELEVEN_FLASH Eleven Labs flash V2.5 32 ~350ms
ELEVEN_V3 Eleven Labs V3 70+ ~2000ms - 9500ms
Audio Format Description
OGG_OPUS Opus 48kHz samplerate, 32kbs bitrate in an OGG container
WEBM_OPUS Opus 48kHz samplerate, 32kbs bitrate in an WEBM container
MP4_OPUS Opus 48kHz samplerate, 32kbps bitrate in an MP4 container
MP4 AAC 16kHz samplerate, 32kbs bitrate in an MP4 container
PCM Raw 16Khz samplerate, 256kbs bitrate in a PCM Wave container
MP3 (default) MP3 44.1kHz samplerate, 128kbps bitrate
ALAW Alaw 8kHz samplerate, 64kbs bitrate
ULAW Ulaw 8kHz samplerate, 64kbs bitrate

Request body example

{
  voice: '1489sf29hoeinidwniov',
  message: 'Welcome to our company. Press 1 for sales, press 2 for support, or press 3 for accounting.'
}

Response

An audio stream using the specified format

Example

n/a

Errors

Error code Message Description
422 message Message is missing
422 voice Selected voice not found
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/audio/ttstest.txt · Last modified: 2025/09/17 13:10 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki