Expand description
§floravox-ssml
Streaming SSML / plain-text parser with byte- and char-exact source span
tracking, built on quick-xml.
Every word token emitted by parse carries its exact offsets into the
raw input string, so downstream consumers (highlighting, index marks,
lipsync) can map audio timing back onto original text — even when the input
contains XML entities (&), <sub alias> replacements, or
<phoneme> overrides.
use floravox_ssml::{parse, Segment};
let doc = parse("<speak>Hello <mark name=\"m1\"/>world</speak>").unwrap();
assert!(matches!(doc.segments[1], Segment::Mark { ref name, .. } if name == "m1"));Structs§
- Parse
Error - Error type: parsing is lenient, so failures are near-impossible by design.
- Prosody
- Effective prosody for a word or segment, as resolved multipliers
(1.0 = unchanged).
Nonefields inherit the engine default. - Ssml
Document - A flat, ordered representation of the input after SSML resolution.
- Word
Span - A word token with exact source mapping.
Enums§
- SayAs
- How a word should be spoken, from
<say-as interpret-as="...">. - Segment
- One element of the flattened document.
Functions§
- parse
- Parse SSML or plain text into an
SsmlDocument. - parse_
break_ strength - W3C break strengths mapped to default millisecond pauses.
- parse_
pitch - Parse a pitch value: percentage, semitones (
"+3st"), or W3C names. - parse_
rate - Parse a rate value: ratio (
"0.8"), percentage ("80%"), relative ("+20%"/"-20%"), or W3C names. - parse_
time - Parse an SSML time value (
"500ms","2s","1.5s", bare number = ms). - parse_
volume - Parse a volume value: percentage, relative, W3C names, or 0–100 number.