Features · SSML
SSML
Put an SSML 1.1 document in the text of a DIVE request to control pauses, reading, rate, pitch and volume, voices, inserted sounds and position marks.
Synthesizing with SSML
Use the same endpoints and fields as plain text requests and send an SSML document as text.
Supported endpoints
https://api-console.humelo.net/api/v1/divehttps://api-console.humelo.net/api/v1/dive/streamwss://api-console.humelo.net/api/v1/dive/ws- A request whose
textis a string starting with<speakis read as an SSML document. There is no extra field or header. Leading whitespace, an XML declaration and comments are skipped. - SSML works on DIVE Standard, Streaming and WebSocket.
- This is a partial implementation of SSML 1.1. Effects the engine cannot render are read without the effect; malformed documents and values are rejected with 400.
textmust be a single string. An SSML document inside an arraytextis rejected with 400.- The request
speed,pitch,volume,sentenceSilenceSecanddictionaryIdact as document-wide defaults that SSML tags build on.
Authentication and headers
Store API keys in server environment variables and send them only in request headers.
X-API-Key: {YOUR_API_KEY}
Content-Type: application/jsonRequest example
curl -X POST https://api-console.humelo.net/api/v1/dive \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"voiceName": "나나",
"emotion": "neutral",
"outputFormat": "mp3_48000_128",
"text": "<speak>안녕하세요.<break time=\"500ms\"/>오늘 날짜는 <say-as interpret-as=\"date\" format=\"ymd\">2026-10-23</say-as>입니다.</speak>"
}'Characters and billing
- Character limits and billing count the speakable text without tags.
subcounts itsalias,phonemeitsph, andsay-asthe original text before it is expanded into words. - Time added by
audio,breakorprosody durationis not billed.
Supported elements
These elements and attributes are interpreted. An SSML element or attribute not listed returns 400; elements from other namespaces (prefixed) are ignored and their content is read.
Document structure
| Element | Attributes | Behavior |
|---|---|---|
<speak> | version, xml:lang, xml:base, startmark, endmark | Document root. version is 1.0 or 1.1 and may be omitted. xml:lang (ko, en) overrides the request lang. With startmark/endmark, only the part between those marks is synthesized. A startmark after its endmark leaves nothing to read and returns 400. |
<p>, <s> | xml:lang | Paragraph and sentence boundaries. Sentences are separated by sentenceSilenceSec (default 0.4 s), paragraphs by twice that (up to 2 s). |
<meta>, <metadata>, <desc> | — | Not spoken. |
Pauses
| Element | Attributes | Behavior |
|---|---|---|
<break> | time, strength | Pauses for time (for example 500ms or 1.5s, up to 10 s) or strength. Without attributes it is medium. It replaces the sentence or paragraph pause at the same position. |
How text is read
| Element | Attributes | Behavior |
|---|---|---|
<say-as> | interpret-as, format, detail | Sets how numbers, characters, dates, times and phone numbers are read. The six values in the say-as table below are supported. |
<sub> | alias | Reads alias instead of the content. Use it for abbreviations and symbols. |
<phoneme> | alphabet, ph | With alphabet="x-hangul" (the default) the Hangul spelling in ph is read. Other alphabets such as ipa read the content without effect. |
<lexicon>, <lookup> | uri, xml:id, type, fetchtimeout / ref | Loads a PLS 1.0 pronunciation lexicon and applies it to text inside lookup. alias entries and alphabet="x-hangul" phoneme entries are used. Latin and digit graphemes match whole words. |
<token>, <w> | role | Treats the content as one word and separates it from adjacent text. role is not used. |
Rate, pitch and volume
| Element | Attributes | Behavior |
|---|---|---|
<prosody> | rate | Speaking rate. The values below and N% multiply the request rate, regardless of an enclosing prosody rate. +N% and -N% change the current rate. Clamped to 0.5–2.0×. |
<prosody> | pitch | Voice pitch. The values below are levels from the request pitch; ±Nst (semitones), ±N% and ±NHz change the current pitch, and NHz targets that pitch (±Nst/±N% inside NHz change that target). Clamped to ±6 semitones. Hz values are matched by measuring the median pitch of the synthesized span. |
<prosody> | volume | Volume. The values below are levels from the request volume; ±NdB changes the current volume. ±NdB inside silent stays silent, while named values and default make it audible again. Up to about +6 dB. |
<prosody> | duration | Synthesizes the content and stretches or compresses it to duration (for example 3s, within 0.5–2.0×). rate on the same element is ignored and duration cannot be nested. |
Voice and language
| Element | Attributes | Behavior |
|---|---|---|
<voice> | name, onvoicefailure | Switches to a preset voice, always with the neutral emotion. Several space-separated names are tried in order. An unknown name returns 404 (E4301); with onvoicefailure="keepexisting" the current voice is kept. |
<lang> | xml:lang, onlangfailure | Switches between Korean (ko) and English (en). Other languages follow onlangfailure: ignoretext skips the text, any other value reads it in the current language. |
Audio and marks
| Element | Attributes | Behavior |
|---|---|---|
<audio> | src, clipBegin, clipEnd, repeatCount, repeatDur, soundLevel, speed, fetchtimeout | Fetches the audio at src and inserts it. Clipping, repeating (repeatDur wins over repeatCount), level (±60 dB) and playback speed (25–400%) are applied. A fetch or decode failure returns 400 (E4203); fallback text inside is not read. |
<mark> | name | Reports the time (seconds) of its position in the response marks. It does not change the audio. |
Named values
Values you can use instead of numbers and what they apply.
break strength
| Value | Applies |
|---|---|
none | 0 s |
x-weak | 0.1 s |
weak | 0.25 s |
medium | 0.5 s (default) |
strong | 0.75 s |
x-strong | 1 s |
prosody rate
| Value | Applies |
|---|---|
x-slow | 0.6× |
slow | 0.8× |
medium | 1× |
fast | 1.25× |
x-fast | 1.5× |
prosody pitch
| Value | Applies |
|---|---|
x-low | −4 semitones |
low | −2 semitones |
medium | 0 |
high | +2 semitones |
x-high | +4 semitones |
prosody volume
| Value | Applies |
|---|---|
silent | Muted |
x-soft | −12 dB |
soft | −6 dB |
medium | 0 dB |
loud | +3 dB |
x-loud | +6 dB |
say-as interpret-as
The six W3C say-as values are supported. Output follows the document language (ko or en).
| Value | format · detail | Input | Reading |
|---|---|---|---|
cardinal | format: decimal separator, detail: grouping separator | 1,234,500 · -3.5 | one million two hundred thirty-four thousand five hundred · minus three point five |
ordinal | — | 1 · 21 · 123 | first · twenty-first · one hundred twenty-third |
characters | format: characters (default) or glyphs, detail: group sizes (for example 3 1 2) | AB12 | A B one two |
date | format: mdy, dmy, ymd, md, dm, ym, my, d, m, y (separators - / .) | 2026-10-23 (ymd) | October twenty-third, twenty twenty-six |
time | format: hms24, hms12 (AM or PM). Seconds may be decimal | 15:30 · 3:30 PM | fifteen thirty · three thirty P M |
telephone | format: country code (not read) | 1588-1234 | one five eight eight, one two three four |
- An
interpret-asother than the six above returns 400 (E4201). An unknownformatis ignored, and one that does not fit the content is retried without it; if the content still does not fit, it is read as plain text. An unknownformatand a plain-text fallback are reported as warnings (warnings). cardinalreads Sino-Korean numerals. An integer directly followed by a counter such as 개, 명, 시 or 번 is read by the same rules as plain text (<say-as interpret-as="cardinal">3</say-as>개→ 세개).ordinalreads an order (세 번째). Up to 99 it uses native Korean numerals; from 100 only a last digit 1–9 stays native (백한 번째, 백십 번째). Numbering such as "3번 출구" is plain text, notordinal.charactersspells accented Latin letters as the base letter and mark (ö → o with umlaut), Greek and Cyrillic letters by name (α → alpha), and never drops a character. Adateyear with a leading zero is read as written (02 → oh two).
Examples
Copy an example into text as is. Replace example.com URLs with your own file URLs.
Paragraphs, sentences and pauses
Default sentence and paragraph pauses, and a pause set with break time.
<speak><p><s>안녕하세요.</s><s>프로소디 안내 방송입니다.</s></p><p>잠시 후<break time="1s"/>열차가 도착합니다.</p></speak>break strength
Compares pause lengths from none to x-strong.
<speak>하나<break strength="none"/>둘<break strength="x-weak"/>셋<break strength="weak"/>넷<break strength="medium"/>다섯<break strength="strong"/>여섯<break strength="x-strong"/>일곱</speak>say-as: amounts and order
cardinal and ordinal.
<speak>결제 금액은 <say-as interpret-as="cardinal">1,234,500</say-as>원입니다. <say-as interpret-as="ordinal">3</say-as> 정류장에서 내리세요.</speak>say-as: codes and phone numbers
characters reads one character at a time; telephone reads the number in groups.
<speak>예약 코드는 <say-as interpret-as="characters">AB12</say-as>입니다. 문의는 <say-as interpret-as="telephone">1588-1234</say-as>로 해 주세요.</speak>say-as: dates and times
date format="ymd" and time format="hms12".
<speak>출발일은 <say-as interpret-as="date" format="ymd">2026-10-23</say-as>, 출발 시각은 <say-as interpret-as="time" format="hms12">3:30 PM</say-as>입니다.</speak>say-as: flight and seat
Combines standard values to read a flight number and a seat.
<speak><say-as interpret-as="characters">KE</say-as><say-as interpret-as="cardinal">123</say-as>편 탑승을 시작합니다. 좌석 <say-as interpret-as="cardinal">23</say-as><say-as interpret-as="characters">A</say-as> 손님은 탑승구로 와 주세요.</speak>sub: abbreviations
Reads alias instead of the abbreviation.
<speak><sub alias="세계보건기구">WHO</sub> 기준에 따라 안내합니다.</speak>phoneme: Hangul spelling
Reads the sound written in x-hangul.
<speak><phoneme alphabet="x-hangul" ph="실라">신라</phoneme> 호텔 앞 정류장입니다.</speak>lexicon and lookup: pronunciation lexicon
Replaces lexicon graphemes inside lookup.
<speak><lexicon xml:id="trains" uri="https://example.com/lexicons/prosody.pls"/><lookup ref="trains">KTX와 SRT 승강장은 지하 1층입니다.</lookup></speak>prosody rate
Slow, normal and fast.
<speak><prosody rate="slow">천천히 말합니다.</prosody> 보통 속도입니다. <prosody rate="fast">빠르게 말합니다.</prosody></speak>prosody pitch
Changes pitch in semitones and in Hz.
<speak><prosody pitch="-3st">낮은 목소리입니다.</prosody> 보통 높이입니다. <prosody pitch="+3st">높은 목소리입니다.</prosody> <prosody pitch="250Hz">이백오십 헤르츠에 맞춥니다.</prosody></speak>prosody volume
Soft, normal and loud.
<speak><prosody volume="soft">작게 말합니다.</prosody> 보통 크기입니다. <prosody volume="loud">크게 말합니다.</prosody></speak>prosody duration
Fits one sentence into exactly three seconds.
<speak>다음 문장을 삼 초에 맞춥니다. <prosody duration="3s">이 문장은 정확히 삼 초 동안 읽습니다.</prosody></speak>voice: switching voices
Switches from the request voice (Nana) to Yungi and back.
<speak>안녕하세요, 나나입니다. <voice name="윤기">저는 윤기입니다.</voice> 다시 나나입니다.</speak>lang: mixing English
Switches to English inside a Korean sentence.
<speak>이번 역은 <lang xml:lang="en-US">Seoul Station</lang>입니다.</speak>audio: inserting sounds
Inserts a chime, then repeats it twice 6 dB lower.
<speak>안내를 시작합니다.<audio src="https://example.com/sounds/chime.wav"/>열차가 들어오고 있습니다.<audio src="https://example.com/sounds/chime.wav" repeatCount="2" soundLevel="-6dB"/>안전선 밖으로 물러나 주세요.</speak>mark: reporting positions
The response marks holds the time of each mark.
<speak><mark name="start"/>첫 번째 안내입니다.<break time="700ms"/><mark name="second"/>두 번째 안내입니다.<mark name="end"/></speak>startmark and endmark: synthesizing a part
Synthesizes only the text between the two marks.
<speak startmark="a" endmark="b">이 부분은 읽지 않습니다. <mark name="a"/>이 부분만 읽습니다.<mark name="b"/> 여기도 읽지 않습니다.</speak>Tags read without effect
emphasis and prosody contour/range are accepted and read without effect.
<speak><emphasis level="strong">중요한</emphasis> 안내입니다. <prosody contour="(0%,+20Hz) (100%,-10Hz)" range="x-high">이 문장은 보통처럼 읽습니다.</prosody></speak>Marks and warnings in responses
Each response type carries mark positions and warnings (warnings) in the place below.
| Response | Location |
|---|---|
| Standard, JSON response | "marks": [{ "name": "start", "time": 0 }], "warnings": ["..."] |
Standard, rawData: true | X-Prosody-Marks: [...], X-Prosody-Warnings: [...] |
| Streaming | Trailer X-Prosody-Marks: [...], X-Prosody-Warnings: [...] |
| WebSocket | { "type": "completed", "marks": [...], "warnings": [...] } |
- Warnings (
warnings) list what was synthesized differently from the document: values limited to the engine range (prosody rate/pitch/volume,break10 s,audio soundLevel/speed/fetchtimeout, Hz pitch ±6 semitones,duration0.5–2×), asay-ascontent orformatmismatch, and an unsupported language orphonemealphabet. For exampleline 2: prosody rate "300%" is outside 0.5–2× of normal speed; read at 2×. Without warnings the field and header are absent. - Header and trailer values are JSON with non-ASCII characters escaped as
\uXXXX. - Browser
fetchcannot read HTTP trailers. Use WebSocket when a browser needs streaming marks. - Marks at pauses, audio and sentence boundaries are exact; marks inside a sentence are estimated from the character position. Streaming delivers all marks when synthesis completes.
Fetching audio and lexicons
The server fetches audio src and lexicon uri itself.
srcaccepts publichttps/httpURLs anddata:URIs. Private, loopback and link-local addresses, and redirects to them, are blocked. Up to three redirects are followed.- WAV (PCM, float, μ-law, A-law), AU, headerless 8 kHz G.711 (
audio/basic,audio/x-alaw-basic), MP3, OGG, FLAC, AAC/M4A, WebM and AIFF are decoded. - Each resource must be at most 10 MiB and arrive within 5 s by default (
fetchtimeoutup to 30 s); all resources of one request must arrive within 60 s. Fetched files are not cached. - Lexicons (PLS) follow the same rules; a failure returns 400 (E4201).
Accepted without effect or not supported
emphasisandprosody contour/rangeare accepted without effect. Whencontouris present,pitchon the same element is not applied either.- A
phonemein IPA or any alphabet other thanx-hangulis not used; its text is read and a warning is returned. voicedoes not select bygender,age,variantorlanguages; usename. Avoicewithout any attribute returns 400.- SSML 1.0 style numbers (
rate="1.5",volume="80") are rejected (400). Use SSML 1.1 values such as150%or+3dB. - DTD entities are not expanded; using a declared entity returns 400.
- Elements and attributes SSML does not define (typos such as
<emphsis>orstrenght="weak") return 400 (E4201).detailsnames the line and the closest valid name (for exampleline 1: unknown element <emphsis>; did you mean <emphasis>?). - Elements and attributes from other namespaces (prefixed, such as
amazon:effectormstts:express-as) are ignored and their content is read, so SSML written for other TTS services does not fail.
Good to know
- Splitting a sentence with tags (changing rate, pitch, volume or voice, or adding
breakoraudio) synthesizes each part separately. A part that ends mid-sentence is read with a continuing intonation, but changing whole sentences still sounds most natural. - So that Korean particles stay attached, tags that do not change the sound (
sub,say-as,lookup) are joined to adjacent text (<sub alias="세계보건기구">WHO</sub>는reads "세계보건기구는"). - The dictionary (
dictionaryId) applies only to plain text and never to text produced bysay-as,sub,phonemeor a lexicon. - English (
langen) sounds natural only with voices that support English.
Limits
Per document. Exceeding one returns 400.
| Item | Limit |
|---|---|
| Elements | 4,096, nested up to 32 levels |
| Synthesis segments | 256 |
| Marks | 200, names up to 128 bytes |
| Total pauses | 120 s |
| audio | 32, 180 s per file, 120 s per clip, 300 s in total |
| lexicon | 8, 5,000 entries in total |
| Spoken text | 8× the character limit after say-as and lexicons |
Errors
Errors caused by SSML. Other errors are the same as for plain DIVE requests.
| HTTP | Code | When |
|---|---|---|
| 400 | E4201 | Malformed XML, an element, attribute or interpret-as SSML does not define, unsupported values, exceeded limits, a lexicon that cannot be fetched or parsed, or a document with nothing to speak |
| 400 | E4203 | audio cannot be fetched or decoded, or audio length limits are exceeded |
| 403 | E4101 | SSML requested on a plan other than Pro or Enterprise |
| 404 | E4301 | An unknown voice in voice name |