How to Generate SSML from Plain Text
Enter plain text, select a voice and speech controls, then generate SSML markup for use with a text-to-speech engine. The result is structured markup rather than an audio recording.
What the SSML workflow provides
This tool turns supplied plain text into Speech Synthesis Markup Language (SSML) markup for use with text-to-speech engines. It is useful when you need structured speech input with a selected voice and adjustable rate, pitch, or volume settings instead of an audio recording. The result gives a text-to-speech engine information about how the written content should be organized and characterized.
The source text can contain separate lines and paragraphs. Nonempty lines are grouped into sentence elements, while two consecutive line breaks separate paragraph elements. Before generating the result, decide where those divisions belong and check that the wording is ready for the engine that will receive the markup. If your source is formatted HTML, convert it to plain text first so you can inspect the actual wording and line structure.
Steps to generate the markup
-
Enter the wording you want to prepare for speech. Text is optional at the input stage, but the effective value must contain at least one non-whitespace character for generated markup to be returned. Keep separate paragraphs apart with two consecutive line breaks when that structure matters.
-
Choose a voice name if the receiving text-to-speech engine expects a particular voice. If you leave the voice field unset, the default voice name is
default. Providing a name here identifies the voice choice in the generated SSML; it does not turn the tool into a speech engine. -
Set the speech controls. Choose a rate from
x-slow,slow,medium,fast, orx-fast. Choose a pitch fromx-low,low,medium,high, orx-high. Choose a volume fromsilent,x-soft,soft,medium,loud, orx-loud. -
Generate the result and inspect the SSML markup. Recognized rate and pitch choices are represented as relative percentage values, while recognized volume choices are represented as numeric levels. If a supplied value is not recognized, that control falls back to its corresponding medium setting.
-
Check the text structure before using the markup with a text-to-speech engine. The supplied text is XML-escaped before it is placed in the markup. Nonempty lines become sentence elements, and double line breaks create paragraph separation. Confirm that the chosen voice name and control values suit the engine that will receive the result. The HTML to Plain Text tool can help prepare formatted HTML content before this input step.
How to read the generated structure
A successful result is SSML markup, which is a structured text representation rather than spoken audio. Use it with a text-to-speech engine that accepts SSML, and inspect the markup before sending it to that destination. The generated structure describes the selected voice and speech controls alongside the submitted words.
XML escaping represents reserved characters in a form that can appear inside the markup. A nonempty line is organized as a sentence element, and a pair of line breaks indicates a paragraph boundary. These rules describe the organization of the supplied text; they do not determine how a particular engine will pronounce or render it.
Rate and pitch settings are represented as relative percentage values, whereas volume settings are represented as numeric levels. When the effective input is empty or contains only whitespace, the tool returns successfully with an error indication instead of generated SSML. Add meaningful text and generate the result again before assessing the voice or control settings. Check compatibility with the destination engine because acceptance of generated markup by a particular engine is not guaranteed.
Worked example
You are preparing one short announcement for a text-to-speech engine and want a slower delivery with a softer volume.
Enter Welcome to the morning briefing. as one line, leave the voice name unset, choose slow, medium, and soft for rate, pitch, and volume, then generate the result.
The result is SSML markup containing the entered announcement in XML-escaped form, a sentence element for its nonempty line, and representations of the selected slow rate, medium pitch, and soft volume.
Limitations
- The tool generates SSML markup rather than producing or playing an audio recording.
- A particular text-to-speech engine may not accept the generated markup.
Common errors
- An empty or whitespace-only input returns an error indication instead of SSML markup. Enter at least one non-whitespace character, then generate the result again.
FAQ
Can I generate SSML without entering text?
The input may be left unset because it defaults to an empty value, but whitespace-only content returns an error indication rather than SSML. Add text containing a non-whitespace character before generating the result.
What voice does the generated SSML use?
Leaving the voice name unset uses default in the generated markup. You may provide another name when the text-to-speech engine receiving the result recognizes that voice.
What happens if a speech setting is not recognized?
A rate, pitch, or volume value outside the listed choices falls back to medium for that setting. Select a recognized option when you want a different control value represented in the output.