Allow Voice Analyzers to recognize languages

This commit is contained in:
r4d6
2020-01-05 23:55:31 -05:00
parent 6d3345d166
commit f6099f341b
+8 -5
View File
@@ -15,6 +15,7 @@
verb_exclaim = "beeps"
var/listening = FALSE
var/recorded = "" //the activation message
var/languages // The Message's language
var/mode = 1
var/static/list/modes = list("inclusive",
"exclusive",
@@ -33,23 +34,25 @@
if(listening && !radio_freq)
record_speech(speaker, raw_message, message_language)
else
if(check_activation(speaker, raw_message))
addtimer(CALLBACK(src, .proc/pulse, 0), 10)
if(message_language == languages) // If it isn't in the same language as the message, don't try to find the message
if(check_activation(speaker, raw_message))
addtimer(CALLBACK(src, .proc/pulse, 0), 10)
/obj/item/assembly/voice/proc/record_speech(atom/movable/speaker, raw_message, datum/language/message_language)
languages = message_language // Assign the message's language to a variable to use it elsewhere
switch(mode)
if(INCLUSIVE_MODE)
recorded = raw_message
listening = FALSE
say("Activation message is '[recorded]'.", message_language)
say("Activation message is '[recorded]'.", language = languages) // Say the message in the language it was said in
if(EXCLUSIVE_MODE)
recorded = raw_message
listening = FALSE
say("Activation message is '[recorded]'.", message_language)
say("Activation message is '[recorded]'.", language = languages)
if(RECOGNIZER_MODE)
recorded = speaker.GetVoice()
listening = FALSE
say("Your voice pattern is saved.", message_language)
say("Your voice pattern is saved.", language = languages)
if(VOICE_SENSOR_MODE)
if(length(raw_message))
addtimer(CALLBACK(src, .proc/pulse, 0), 10)