Beispiel #1
0
        public static void Speak(string str, bool isForce = false)
        {
            if (g_VoiceSpeeach == null)
            {//未初期化
                return;
            }

            str = U.table_replace(str, ConvertTable);
            if (str.Length <= 0)
            {
                return;
            }
            if (isForce == false)
            {
                if (g_CurrentString == str)
                {//既に読み上げた文字列は再度読み上げしない
                    return;
                }
            }
            if (str.Length < g_ShortLength)
            {//短すぎ
                return;
            }
            g_CurrentString = str;

            bool isSpeech = !g_VoiceSpeeach.WaitUntilDone(0);

            if (isSpeech)
            {
                g_VoiceSpeeach.Speak(" ", SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak);
            }
            g_VoiceSpeeach.Speak(g_CurrentString, SpeechVoiceSpeakFlags.SVSFlagsAsync);
        }
Beispiel #2
0
        // 読み上げスキップ
        private void skipSpeech()
        {
            if (!this.SettingInstanse.talker || !boolTalkable || VoiceSpeech == null)
            {
                return;
            }
            boolSkipFlag = true;

            // 終わるまで待つ
            if (VoiceSpeech.Status.RunningState == SpeechRunState.SRSEIsSpeaking)
            {
                VoiceSpeech.Skip("Sentence", int.MaxValue);
                VoiceSpeech.WaitUntilDone(1000);
            }
        }