yeah so currently my system displays the correct n...
# ask-ai
a
yeah so currently my system displays the correct numeric but now the TTS completely messes up the spoken numeric because it is not TTS friendly. How can I get around making the TTS speak the numbers in a friendly way but also display the numeric price? ie. $118,294.65 displayed as normal but spoken as “one hundred eighteen thousand two hundred ninety-four dollars sixty five cents”
t
Thanks for reaching out, mackiannii. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To make the TTS speak numbers in a friendly way while still displaying the numeric values, you can use the following approaches: 1. Custom Number-to-Words Conversion: Before sending the text to the TTS system, you can implement a function to convert numbers into words. For example, "$118,294.65" can be converted to "one hundred eighteen thousand two hundred ninety-four dollars sixty-five cents" for the TTS output, while keeping the numeric value for display purposes. 2. Use SSML (Speech Synthesis Markup Language): Many TTS systems support SSML, which allows you to define how specific parts of the text should be spoken. You can use SSML to specify the spoken form of the numbers while keeping the numeric format for display. 3. Provider-Specific Features: Some TTS providers offer built-in text normalization or pronunciation customization. Check if your TTS provider supports features like text normalization or custom pronunciation rules to handle numbers effectively. These methods allow you to separate the visual representation of numbers from their spoken form, ensuring both are optimized for their respective purposes. Sources: Speechify TTS integration guide | LiveKit Docs | tools/tts/tts.cpp | Agent speech and audio | LiveKit Docs | OpenAI TTS integration guide | LiveKit Docs | Speech & Audio Processing | livekit/livekit_composite | DeepWiki
a
anyone have luck with this? 1. Use SSML (Speech Synthesis Markup Language): Many TTS systems support SSML, which allows you to define how specific parts of the text should be spoken. You can use SSML to specify the spoken form of the numbers while keeping the numeric format for display.
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!