Client side with replace_text
replace_text builds one transform from a list of (pattern, replacement) pairs. It works with every TTS service because the substitution happens in Pipecat before the text is sent.
- Order matters. Rules run in sequence, so an earlier replacement can change what a later rule matches.
- Use word boundaries (
\b) so “cat” does not rewrite the middle of “catheter”.
Provider side lexicons
Some services host the lexicon for you. This keeps the list out of your process but ties you to that provider.Azure has no pronunciation lexicon path in Pipecat.
AzureTTSService
escapes your text before wrapping it in SSML, so a <phoneme> tag injected by
a text transform is read out loud as literal characters. There is no flag to
turn this off. On Azure, use respellings through replace_text.