public static void playVoice(string systemName, systemVoice.Tone tone, string msg) { systemVoice.Voice system = SystemVoice.applyVoiceTone(returnVoiceByName(systemName), tone); voice_AudioSource.loop = false; voice_AudioSource.volume = system.volume; voice_AudioSource.pitch = system.pitch; Speaker.Speak(msg, voice_AudioSource, Speaker.VoicesForCulture(system.culture.ToString())[system.cultureIndex]); }
private void onEnableTextToSpeech() { GameObject rtVoice = Instantiate(Resources.Load("rtVoice"), gameObject.transform.position, Quaternion.identity) as GameObject; rtVoice.transform.parent = gameObject.transform; rtVoice.tag = "rtVoices"; SystemVoice = _SystemVoice; }