Crate ssml

Source
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.
CustomElement
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
ProsodyContour
ProsodyControl
SayAs
SerializeOptions
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.
TimeDesignation
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.
VoiceConfig
Configuration for the Voice element.
XmlWriter
A utility for writing optionally formatted XML to a Write stream.

Enums§

AudioRepeat
Specify repeating an Audio element’s playback for a certain number of times, or for a determined duration.
Break
BreakStrength
DateFormat
DecibelsError
Element
Represents all SSML elements.
EmphasisLevel
Error
Flavor
Vendor-specific flavor of SSML. Specifying this can be used to enable compatibility checks & add additional metadata required by certain services.
ProsodyPitch
ProsodyRate
ProsodyVolume
SpeechFormat
TimeDesignationError
VoiceGender

Traits§

EscapedDisplay
IntoElement
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.

Type Aliases§

Result