mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[GH-ISSUE #13775] feat: Abiility to Filter Text before its sent for TTS Synthesis #87767
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @digitalassassins on GitHub (May 11, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13775
Check Existing Issues
Problem Description
Im not sure if this is available as I can't find anything anywhere in the docs, and searching the codebase.
I've tried all the TTS options. Ive used the built-in Microsoft Voices (Legacy & Natural) by installing the Natural Voices SAPI Adapter. TTS-1, TTS-1-HD, kokoro.js, Kokoro-Fast, openedai-speech
They all seem to have the same speech synthesis issues.
The built-in Microsoft Natural voices in Windows sound great and use fewer resources, but they read all the markdown. The same on Google with the built-in TTS on Android. The Following bit of Text:
is read out aloud by the TTS in words as:
"asterisk asterisk asterisk asterisk asterisk Modify asterisk asterisk Streaming.
asterisk asterisk asterisk Implement asterisk asterisk Censorship asterisk asterisk.
asterisk asterisk asterisk asterisk asterisk Monitor asterisk asterisk Data."
which is extremely annoying, switching to kokoro.js fixes the issue, but then crashes my account on an Android device. Switching to Kokoro-Fast, openedai-speech, TTS-1, TTS-1-HD. fixes this on Android but then all the TTS models struggle with this, to name but a few:
AI is read out as "Eye"
Weblinks (https://www.google.com/blog) are read out as:
"His is pes , woo woo wee , dot google dot com forward slash blog" etc..
I've tried filtering the streaming data before it hits the page, which works. But then the writing becomes unreadable in the chat window. I tried filtering the end chat result after it was written to the page. But it does nothing.
If this filter is already available, could somebody point me in the direction of where python sends the text from the chat to be synthesised?
Desired Solution you'd like
Would like the ability to write a filter for the text before it's sent to the TTS for synthesis. so we could strip the markdown and any misgivings we find in the TTS. We could filter out and replace using .replace or regex.
This would allow us to filter characters like * \ [ ] , as it seems counterintuitive to send page markdown to the TTS
we could replace "https://www." as "Weblink:" so the TTS said:
Weblink: google dot com forward slash blog
Instead of:
"His is pes , woo woo wee , dot google dot com forward slash blog"
Alternatives Considered
No response
Additional Context
No response