Files
The SharkeningandGitHub 06f2f5b7ec Integrates vocal barks with TTS (#2811)
- Intigrates vocal barks into TTS.
- If TTS voice is None, broadcasts vocal barks to everyone else.

🆑
add: TTS compatability with vocal barks
/🆑
2025-02-02 01:11:48 +02:00

22 lines
704 B
Plaintext

/// The option for not having a voice.
/datum/preference/choiced/voice/init_possible_values()
if(SStts.tts_enabled)
return list(TTS_VOICE_NONE) + SStts.available_speakers
if(fexists("data/cached_tts_voices.json"))
var/list/text_data = rustg_file_read("data/cached_tts_voices.json")
var/list/cached_data = json_decode(text_data)
if(!cached_data)
return list("invalid")
return list(TTS_VOICE_NONE) + cached_data
return list("invalid")
/datum/preference/choiced/voice/apply_to_human(mob/living/carbon/human/target, value)
if(SStts.tts_enabled && !(value in cached_values))
value = pick(SStts.available_speakers) // As a failsafe
target.voice = value == TTS_VOICE_NONE ? "" : value