Expand description
Utilities for writing SSML documents.
The root document in SSML is Speak
. Use speak()
to quickly create a document.
let doc = ssml::speak(Some("en-US"), ["Hello, world!"]);
Use Serialize
to convert SSML elements to their string XML representation, which can then be sent to your speech
synthesis service of chocie.
use ssml::Serialize;
let str = doc.serialize_to_string(&ssml::SerializeOptions::default().pretty())?;
assert_eq!(
str,
r#"<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">
Hello, world!
</speak>"#
);
Modules§
- mstts
- Elements exclusive to [
Flavor::MicrosoftAzureCognitiveSpeechServices
] (ACSS/MSTTS). - util
- Utilities for serializing XML.
- visit
- Walk through all elements of an SSML document.
- visit_
mut
Structs§
- Audio
Audio
supports the insertion of recorded audio files and the insertion of other audio formats in conjunction with synthesized speech output.- Custom
Element - Decibels
- A string representation of a signed amplitude offset in decibels (
dB
). - Emphasis
- Group
- Lang
- Mark
- Meta
- An
Element
that outputs a string of XML. - Prosody
- Prosody
Contour - Prosody
Control - SayAs
- Serialize
Options - Configuration for elements that support
Serialize
. - Speak
- The root element of an SSML document.
- Text
- A non-marked-up string of text for use as a spoken element.
- Time
Designation - A time designation is a representation of a non-negative offset of time.
- Voice
- The
Voice
element allows you to specify a voice or use multiple different voices in one document. - Voice
Config - Configuration for the
Voice
element. - XmlWriter
- A utility for writing optionally formatted XML to a
Write
stream.
Enums§
- Audio
Repeat - Specify repeating an
Audio
element’s playback for a certain number of times, or for a determined duration. - Break
- Break
Strength - Date
Format - Decibels
Error - Element
- Represents all SSML elements.
- Emphasis
Level - Error
- Flavor
- Vendor-specific flavor of SSML. Specifying this can be used to enable compatibility checks & add additional metadata required by certain services.
- Prosody
Pitch - Prosody
Rate - Prosody
Volume - Speech
Format - Time
Designation Error - Voice
Gender
Traits§
- Escaped
Display - Into
Element - Serialize
- Trait to support serializing SSML elements.
Functions§
- audio
- Creates a new
Audio
element with an audio source URI. - breaks
- emphasis
- group
- lang
- mark
- prosody
- say_as
- speak
- Creates a new SSML document with elements.
- text
- Creates a spoken
Text
element from a string. - voice
- Creates a new
voice
element to change the voice of a section of spoken elements.