mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
## About The Pull Request ``speaker`` is the voice, not the atom itself ## Changelog 🆑 fix: Fixed TTS filters (sometimes) not working /🆑
11 lines
468 B
Plaintext
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)
|