Files
Iamgoofball 33824ac7c1 TTS 3.0: Blips Rework, Radio TTS, Unknown Languages are Blips now (#95369)
## About The Pull Request

Re-did blips to be significantly nicer sounding and way better. Alien
speech you don't understand now comes through as Blips. If you have TTS
entirely disabled, you won't hear blips. Blips also now include more
customization options, and a dedicated Blips preview button by clicking
the leaf icon.

<img width="1749" height="354" alt="ApplicationFrameHost_5nKJEvaNV1"
src="https://github.com/user-attachments/assets/ef6c6b61-7c22-4a87-94c9-be50e89c65bb"
/>


https://github.com/user-attachments/assets/8cab7e55-6370-4e4e-99ba-ea2475569453

Radio TTS has been implemented. By default, you will hear all TTS over
the radio, but will not hear yourself over the radio. You can configure
this in Game Settings.


https://github.com/user-attachments/assets/94a44d84-17a9-4e6e-ac5c-3b800b11c159

<img width="743" height="193" alt="chrome_MOIcXaC2gh"
src="https://github.com/user-attachments/assets/907379b7-0689-486c-b29c-9be0a2259b05"
/>

The new TTS stack is located at
https://github.com/Iamgoofball/tgtts-qwen3 and is AGPLv3 licensed. The
new blips design was inspired by
https://github.com/joshxviii/animalese-typing.

The configuration to disable TTS on whispering has been removed, as it
is no longer needed and also interferes with radio TTS functioning
properly.

The Tram now utilizes TTS, and has had a general audio tune-up.


https://github.com/user-attachments/assets/f532d002-939c-43a1-95d0-0f0c43048997

TTS audio is now 3D and in space, see attached.


https://github.com/user-attachments/assets/b00df49a-9d1d-4b27-a8a0-d103099f5c7e

## Why It's Good For The Game

Quality of life improvements to the TTS system, long overdue. Also, TGMC
can migrate to this new method of doing radio audio so they aren't
sending double the TTS requests anymore.

## Changelog

🆑
add: Added support for Radio TTS. You will now hear players over the
radio via the TTS system.
add: Configure this in Game Options under the Sound tab.
sound: Re-did blips to be significantly nicer sounding and way better. 
sound: Alien speech you don't understand now comes through as Blips. If
you have TTS entirely disabled, you won't hear blips.
sound: The Tram and Computers now utilize the TTS system. Configs have
been added to set a consistent voice.
sound: TTS audio now utilizes 3D audio; you can now walk away from
people saying stupid shit and it gets quieter.
sound: Blips also now include more customization options, and a
dedicated Blips preview button by clicking the leaf icon.
del: The configuration to disable TTS on whispering has been removed, as
it is no longer needed and also interferes with radio TTS functioning
properly.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Lucy <lucy@absolucy.moe>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2026-06-15 18:54:24 -04:00

86 lines
3.9 KiB
Plaintext

/mob/dead/observer/check_emote(message, forced)
return emote(copytext(message, length(message[1]) + 1), intentional = !forced, force_silence = TRUE)
//Modified version of get_message_mods, removes the trimming, the only thing we care about here is admin channels
/mob/dead/observer/get_message_mods(message, list/mods)
var/key = message[1]
if((key in GLOB.department_radio_prefixes) && length(message) > length(key) + 1 && !mods[RADIO_EXTENSION])
mods[RADIO_KEY] = LOWER_TEXT(message[1 + length(key)])
mods[RADIO_EXTENSION] = GLOB.department_radio_keys[mods[RADIO_KEY]]
return message
/mob/dead/observer/say(
message,
bubble_type,
list/spans = list(),
sanitize = TRUE,
datum/language/language,
ignore_spam = FALSE,
forced,
filterproof = FALSE,
message_range = 7,
datum/saymode/saymode,
list/message_mods = list(),
)
message = trim(message) //trim now and sanitize after checking for special admin radio keys
var/list/filter_result = CAN_BYPASS_FILTER(src) ? null : is_ooc_filtered(message)
if (filter_result)
REPORT_CHAT_FILTER_TO_USER(usr, filter_result)
log_filter("OOC", message, filter_result)
return
var/list/soft_filter_result = CAN_BYPASS_FILTER(src) ? null : is_soft_ooc_filtered(message)
if (soft_filter_result)
if(tgui_alert(usr,"Your message contains \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[soft_filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to say it?", "Soft Blocked Word", list("Yes", "No")) != "Yes")
return
message_admins("[ADMIN_LOOKUPFLW(usr)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term. Message: \"[html_encode(message)]\"")
log_admin_private("[key_name(usr)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term. Message: \"[message]\"")
if(!message)
return
message = get_message_mods(message, message_mods)
if(client?.holder && (message_mods[RADIO_EXTENSION] == MODE_ADMIN || message_mods[RADIO_EXTENSION] == MODE_DEADMIN || (message_mods[RADIO_EXTENSION] == MODE_PUPPET && mind?.current)))
message = trim_left(copytext_char(message, length(message_mods[RADIO_KEY]) + 2))
switch(message_mods[RADIO_EXTENSION])
if(MODE_ADMIN)
SSadmin_verbs.dynamic_invoke_verb(client, /datum/admin_verb/cmd_admin_say, message)
if(MODE_DEADMIN)
SSadmin_verbs.dynamic_invoke_verb(client, /datum/admin_verb/dsay, message)
if(MODE_PUPPET)
if(!mind.current.say(message))
to_chat(src, span_warning("Your linked body was unable to speak!"))
return
message = copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN)
if(message[1] == "*" && check_emote(message, forced))
return
. = say_dead(message)
/mob/dead/observer/Hear(atom/movable/speaker, message_language, raw_message, radio_freq, radio_freq_name, radio_freq_color, list/spans, list/message_mods = list(), message_range)
. = ..()
var/atom/movable/to_follow = speaker
if(radio_freq)
var/atom/movable/virtualspeaker/V = speaker
if(isAI(V.source))
var/mob/living/silicon/ai/S = V.source
to_follow = S.eyeobj
else
to_follow = V.source
var/link = FOLLOW_LINK(src, to_follow)
var/is_custom_emote = message_mods[MODE_CUSTOM_SAY_ERASE_INPUT]
// Create map text prior to modifying message for goonchat
if (safe_read_pref(client, /datum/preference/toggle/enable_runechat) && (safe_read_pref(client, /datum/preference/toggle/enable_runechat_non_mobs) || ismob(speaker)))
if(is_custom_emote)
create_chat_message(speaker, null, message_mods[MODE_CUSTOM_SAY_EMOTE], spans, EMOTE_MESSAGE)
else
create_chat_message(speaker, message_language, raw_message, spans)
// Recompose the message, because it's scrambled by default
var/message = compose_message(speaker, message_language, raw_message, radio_freq, radio_freq_name, radio_freq_color, spans, message_mods)
to_chat(src,
html = "[link] [message]",
avoid_highlighting = speaker == src)
return HEAR_HEARD | HEAR_UNDERSTOOD