mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 09:08:30 +01:00
- Intigrates vocal barks into TTS. - If TTS voice is None, broadcasts vocal barks to everyone else. 🆑 add: TTS compatability with vocal barks /🆑
22 lines
704 B
Plaintext
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
|