Files
SmArtKarandGitHub 4922e738d3 Fixes TTS filters (sometimes) not working (#94696)
## About The Pull Request

``speaker`` is the voice, not the atom itself

## Changelog
🆑
fix: Fixed TTS filters (sometimes) not working
/🆑
2026-01-03 22:52:47 -07:00

11 lines
468 B
Plaintext

/proc/tts_speech_filter(text)
// Only allow alphanumeric characters and whitespace
var/static/regex/bad_chars_regex = regex("\[^a-zA-Z0-9 ,?.!'&-]", "g")
return bad_chars_regex.Replace(text, " ")
/proc/tts_filter_encode(text, speaker, pitch, blips = FALSE)
text = replacetext(text, "%PITCH%", SStts.pitch_enabled ? pitch : 0)
text = replacetext(text, "%FEMALE%", !!findtext(speaker, "Woman"))
text = replacetext(text, "%BLIPS%", blips)
return url_encode(text)