Prosody

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.

1

Synthesizing with SSML

Use the same endpoints and fields as plain text requests and send an SSML document as text.

Supported endpoints

POST
https://api-console.humelo.net/api/v1/dive
POST
https://api-console.humelo.net/api/v1/dive/stream
GET
wss://api-console.humelo.net/api/v1/dive/ws
  • A request whose text is a string starting with <speak is 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.
  • text must be a single string. An SSML document inside an array text is rejected with 400.
  • The request speed, pitch, volume, sentenceSilenceSec and dictionaryId act 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.

http
X-API-Key: {YOUR_API_KEY}
Content-Type: application/json

Request example

bash
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. sub counts its alias, phoneme its ph, and say-as the original text before it is expanded into words.
  • Time added by audio, break or prosody duration is not billed.
2

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

Document structure
ElementAttributesBehavior
<speak>version, xml:lang, xml:base, startmark, endmarkDocument 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:langParagraph 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

Pauses
ElementAttributesBehavior
<break>time, strengthPauses 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

How text is read
ElementAttributesBehavior
<say-as>interpret-as, format, detailSets how numbers, characters, dates, times and phone numbers are read. The six values in the say-as table below are supported.
<sub>aliasReads alias instead of the content. Use it for abbreviations and symbols.
<phoneme>alphabet, phWith 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 / refLoads 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>roleTreats the content as one word and separates it from adjacent text. role is not used.

Rate, pitch and volume

Rate, pitch and volume
ElementAttributesBehavior
<prosody>rateSpeaking 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>pitchVoice 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>volumeVolume. 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>durationSynthesizes 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

Voice and language
ElementAttributesBehavior
<voice>name, onvoicefailureSwitches 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, onlangfailureSwitches 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

Audio and marks
ElementAttributesBehavior
<audio>src, clipBegin, clipEnd, repeatCount, repeatDur, soundLevel, speed, fetchtimeoutFetches 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>nameReports the time (seconds) of its position in the response marks. It does not change the audio.
3

Named values

Values you can use instead of numbers and what they apply.

break strength

break strength
ValueApplies
none0 s
x-weak0.1 s
weak0.25 s
medium0.5 s (default)
strong0.75 s
x-strong1 s

prosody rate

prosody rate
ValueApplies
x-slow0.6×
slow0.8×
medium1×
fast1.25×
x-fast1.5×

prosody pitch

prosody pitch
ValueApplies
x-low−4 semitones
low−2 semitones
medium0
high+2 semitones
x-high+4 semitones

prosody volume

prosody volume
ValueApplies
silentMuted
x-soft−12 dB
soft−6 dB
medium0 dB
loud+3 dB
x-loud+6 dB
4

say-as interpret-as

The six W3C say-as values are supported. Output follows the document language (ko or en).

say-as interpret-as
Valueformat · detailInputReading
cardinalformat: decimal separator, detail: grouping separator1,234,500 · -3.5one million two hundred thirty-four thousand five hundred · minus three point five
ordinal—1 · 21 · 123first · twenty-first · one hundred twenty-third
charactersformat: characters (default) or glyphs, detail: group sizes (for example 3 1 2)AB12A B one two
dateformat: mdy, dmy, ymd, md, dm, ym, my, d, m, y (separators - / .)2026-10-23 (ymd)October twenty-third, twenty twenty-six
timeformat: hms24, hms12 (AM or PM). Seconds may be decimal15:30 · 3:30 PMfifteen thirty · three thirty P M
telephoneformat: country code (not read)1588-1234one five eight eight, one two three four
  • An interpret-as other than the six above returns 400 (E4201). An unknown format is 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 unknown format and a plain-text fallback are reported as warnings (warnings).
  • cardinal reads 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>개 → 세개).
  • ordinal reads 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, not ordinal.
  • characters spells accented Latin letters as the base letter and mark (ö → o with umlaut), Greek and Cyrillic letters by name (α → alpha), and never drops a character. A date year with a leading zero is read as written (02 → oh two).
5

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.

xml
<speak><p><s>안녕하세요.</s><s>프로소디 안내 방송입니다.</s></p><p>잠시 후<break time="1s"/>열차가 도착합니다.</p></speak>

break strength

Compares pause lengths from none to x-strong.

xml
<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.

xml
<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.

xml
<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".

xml
<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.

xml
<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.

xml
<speak><sub alias="세계보건기구">WHO</sub> 기준에 따라 안내합니다.</speak>

phoneme: Hangul spelling

Reads the sound written in x-hangul.

xml
<speak><phoneme alphabet="x-hangul" ph="실라">신라</phoneme> 호텔 앞 정류장입니다.</speak>

lexicon and lookup: pronunciation lexicon

Replaces lexicon graphemes inside lookup.

xml
<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.

xml
<speak><prosody rate="slow">천천히 말합니다.</prosody> 보통 속도입니다. <prosody rate="fast">빠르게 말합니다.</prosody></speak>

prosody pitch

Changes pitch in semitones and in Hz.

xml
<speak><prosody pitch="-3st">낮은 목소리입니다.</prosody> 보통 높이입니다. <prosody pitch="+3st">높은 목소리입니다.</prosody> <prosody pitch="250Hz">이백오십 헤르츠에 맞춥니다.</prosody></speak>

prosody volume

Soft, normal and loud.

xml
<speak><prosody volume="soft">작게 말합니다.</prosody> 보통 크기입니다. <prosody volume="loud">크게 말합니다.</prosody></speak>

prosody duration

Fits one sentence into exactly three seconds.

xml
<speak>다음 문장을 삼 초에 맞춥니다. <prosody duration="3s">이 문장은 정확히 삼 초 동안 읽습니다.</prosody></speak>

voice: switching voices

Switches from the request voice (Nana) to Yungi and back.

xml
<speak>안녕하세요, 나나입니다. <voice name="윤기">저는 윤기입니다.</voice> 다시 나나입니다.</speak>

lang: mixing English

Switches to English inside a Korean sentence.

xml
<speak>이번 역은 <lang xml:lang="en-US">Seoul Station</lang>입니다.</speak>

audio: inserting sounds

Inserts a chime, then repeats it twice 6 dB lower.

xml
<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.

xml
<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.

xml
<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.

xml
<speak><emphasis level="strong">중요한</emphasis> 안내입니다. <prosody contour="(0%,+20Hz) (100%,-10Hz)" range="x-high">이 문장은 보통처럼 읽습니다.</prosody></speak>
6

Marks and warnings in responses

Each response type carries mark positions and warnings (warnings) in the place below.

Marks and warnings in responses
ResponseLocation
Standard, JSON response"marks": [{ "name": "start", "time": 0 }], "warnings": ["..."]
Standard, rawData: trueX-Prosody-Marks: [...], X-Prosody-Warnings: [...]
StreamingTrailer 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, break 10 s, audio soundLevel/speed/fetchtimeout, Hz pitch ±6 semitones, duration 0.5–2×), a say-as content or format mismatch, and an unsupported language or phoneme alphabet. For example line 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 fetch cannot 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.
7

Fetching audio and lexicons

The server fetches audio src and lexicon uri itself.

  • src accepts public https/http URLs and data: 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 (fetchtimeout up 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).
8

Accepted without effect or not supported

  • emphasis and prosody contour/range are accepted without effect. When contour is present, pitch on the same element is not applied either.
  • A phoneme in IPA or any alphabet other than x-hangul is not used; its text is read and a warning is returned.
  • voice does not select by gender, age, variant or languages; use name. A voice without any attribute returns 400.
  • SSML 1.0 style numbers (rate="1.5", volume="80") are rejected (400). Use SSML 1.1 values such as 150% or +3dB.
  • DTD entities are not expanded; using a declared entity returns 400.
  • Elements and attributes SSML does not define (typos such as <emphsis> or strenght="weak") return 400 (E4201). details names the line and the closest valid name (for example line 1: unknown element <emphsis>; did you mean <emphasis>?).
  • Elements and attributes from other namespaces (prefixed, such as amazon:effect or mstts:express-as) are ignored and their content is read, so SSML written for other TTS services does not fail.
9

Good to know

10

Limits

Per document. Exceeding one returns 400.

Limits
ItemLimit
Elements4,096, nested up to 32 levels
Synthesis segments256
Marks200, names up to 128 bytes
Total pauses120 s
audio32, 180 s per file, 120 s per clip, 300 s in total
lexicon8, 5,000 entries in total
Spoken text8× the character limit after say-as and lexicons
11

Errors

Errors caused by SSML. Other errors are the same as for plain DIVE requests.

Errors
HTTPCodeWhen
400E4201Malformed 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
400E4203audio cannot be fetched or decoded, or audio length limits are exceeded
403E4101SSML requested on a plan other than Pro or Enterprise
404E4301An unknown voice in voice name
SSML 문서 | Prosody Console