ssml 0.2.0

Utilities for working with Speech Synthesis Markup Language documents
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use ssml::{IntoElement, Serialize, SerializeOptions};

fn main() {
	let doc = ssml::speak(Some("en-US"), [
		ssml::text("Hello, world!").into_element(),
		ssml::voice("en-US-Neural2-F", [
			"This is an example of".into_element(),
			ssml::say_as(ssml::SpeechFormat::SpellOut, "SSML").into(),
			" in ".into(),
			ssml::emphasis(ssml::EmphasisLevel::Moderate, ["Rust."]).into()
		])
		.into(),
		ssml::breaks(ssml::Break::new_with_time("1s")).into(),
		"How cool!".into()
	]);
	println!("{}", doc.serialize_to_string(&SerializeOptions::default().pretty()).unwrap());
}