Anda di halaman 1dari 3

Text-to-speech (TTS) API Documentation

The Voice RSS Text-To-Speech API creates high quality audio stream. The API does
n t support callbacks and it synchronously returns audio data or an error message
in the same request.
The Text-To-Speech API provides a very easy and simple one-line use. Just put th
e API key and language in the URL and you'll receive an audio data containing th
e specified text.
Protocols
The Text-To-Speech API supports the following protocols:
HTTP GET and HTTP POST
URL format
The API has the following URL format:
http://api.voicerss.org/?<parameters>
or the following via HTTPS
https://api.voicerss.org/?<parameters>
Where <parameters> is list of parameters that API supports. The parameters may b
e provided in query string (HTTP GET) or as form parameters (HTTP POST) as well.
Example of request
The following example demonstrats request via HTTP GET:
http://api.voicerss.org/?key=<API key>&hl=en-us&src=Hello, world!
Where <API key> is the API key under the account.
Parameters
The Text-To-Speech API supports the following list of parameters. The parameters
have name-value pair (NVP) format.
Parameter name Parameter description
key The API key (mandatory)
src The textual content for converting to speech (length limited by 100KB) (
mandatory).
hl The textual content language. Allows values: see Languages. (mandatory)
r The speech rate (speed). Allows values: from -10 (slowest speed) up to 1
0 (fastest speed). Default value: 0 (normal speed). (optional)
c The speech audio codec. Allows values: see Audio Codecs. Default value:
MP3. (optional)
f The speech audio formats. Allows values: see Audio Formats. Default valu
e: 8khz_8bit_mono. (optional)
ssml The SSML textual content format. Allows values: true and false. Default
value: false. (optional)
b64 Defines output as a Base64 string format (for an internet browser playin
g). Allows values: true and false. Default value: false. (optional)
Languages
The API allows convert textual content to audio format in the following language
s:
Language code Language name
ca-es Catalan
zh-cn Chinese (China)
zh-hk Chinese (Hong Kong)
zh-tw Chinese (Taiwan)
da-dk Danish
nl-nl Dutch
en-au English (Australia)
en-ca English (Canada)
en-gb English (Great Britain)
en-in English (India)
en-us English (United States)
fi-fi Finnish
fr-ca French (Canada)
fr-fr French (France)
de-de German
it-it Italian
ja-jp Japanese
ko-kr Korean
nb-no Norwegian
pl-pl Polish
pt-br Portuguese (Brazil)
pt-pt Portuguese (Portugal)
ru-ru Russian
es-mx Spanish (Mexico)
es-es Spanish (Spain)
sv-se Swedish (Sweden)
Audio Codecs
The API allows convert textual content to audio format in the following codecs:
Audio codec
MP3
WAV
AAC
OGG
CAF
Audio Formats
The API allows convert textual content to audio format in the following formats:
Audio format code Audio format description
8khz_8bit_mono 8 kHz, 8 Bit, Mono
8khz_8bit_stereo 8 kHz, 8 Bit, Stereo
8khz_16bit_mono 8 kHz, 16 Bit, Mono
8khz_16bit_stereo 8 kHz, 16 Bit, Stereo
11khz_8bit_mono 11 kHz, 8 Bit, Mono
11khz_8bit_stereo 11 kHz, 8 Bit, Stereo
11khz_16bit_mono 11 kHz, 16 Bit, Mono
11khz_16bit_stereo 11 kHz, 16 Bit, Stereo
12khz_8bit_mono 12 kHz, 8 Bit, Mono
12khz_8bit_stereo 12 kHz, 8 Bit, Stereo
12khz_16bit_mono 12 kHz, 16 Bit, Mono
12khz_16bit_stereo 12 kHz, 16 Bit, Stereo
16khz_8bit_mono 16 kHz, 8 Bit, Mono
16khz_8bit_stereo 16 kHz, 8 Bit, Stereo
16khz_16bit_mono 16 kHz, 16 Bit, Mono
16khz_16bit_stereo 16 kHz, 16 Bit, Stereo
22khz_8bit_mono 22 kHz, 8 Bit, Mono
22khz_8bit_stereo 22 kHz, 8 Bit, Stereo
22khz_16bit_mono 22 kHz, 16 Bit, Mono
22khz_16bit_stereo 22 kHz, 16 Bit, Stereo
24khz_8bit_mono 24 kHz, 8 Bit, Mono
24khz_8bit_stereo 24 kHz, 8 Bit, Stereo
24khz_16bit_mono 24 kHz, 16 Bit, Mono
24khz_16bit_stereo 24 kHz, 16 Bit, Stereo
32khz_8bit_mono 32 kHz, 8 Bit, Mono
32khz_8bit_stereo 32 kHz, 8 Bit, Stereo
32khz_16bit_mono 32 kHz, 16 Bit, Mono
32khz_16bit_stereo 32 kHz, 16 Bit, Stereo
44khz_8bit_mono 44 kHz, 8 Bit, Mono
44khz_8bit_stereo 44 kHz, 8 Bit, Stereo
44khz_16bit_mono 44 kHz, 16 Bit, Mono
44khz_16bit_stereo 44 kHz, 16 Bit, Stereo
48khz_8bit_mono 48 kHz, 8 Bit, Mono
48khz_8bit_stereo 48 kHz, 8 Bit, Stereo
48khz_16bit_mono 48 kHz, 16 Bit, Mono
48khz_16bit_stereo 48 kHz, 16 Bit, Stereo
alaw_8khz_mono ALaw, 8 kHz, Mono
alaw_8khz_stereo ALaw, 8 kHz, Stereo
alaw_11khz_mono ALaw, 11 kHz, Mono
alaw_11khz_stereo ALaw, 11 kHz, Stereo
alaw_22khz_mono ALaw, 22 kHz, Mono
alaw_22khz_stereo ALaw, 22 kHz, Stereo
alaw_44khz_mono ALaw, 44 kHz, Mono
alaw_44khz_stereo ALaw, 44 kHz, Stereo
ulaw_8khz_mono uLaw, 8 kHz, Mono
ulaw_8khz_stereo uLaw, 8 kHz, Stereo
ulaw_11khz_mono uLaw, 11 kHz, Mono
ulaw_11khz_stereo uLaw, 11 kHz, Stereo
ulaw_22khz_mono uLaw, 22 kHz, Mono
ulaw_22khz_stereo uLaw, 22 kHz, Stereo
ulaw_44khz_mono uLaw, 44 kHz, Mono
ulaw_44khz_stereo uLaw, 44 kHz, Stereo
Errors
The Text-To-Speech API returns the following errors:
Error description
The subscription is expired or requests count limitation is exceeded!
The request content length is too large!
The language does not support!
The language is not specified!
The text is not specified!
The API key is not available!
The API key is not specified!
The subscription does not support SSML!

Anda mungkin juga menyukai