diff --git a/SAPIForVOICEVOX/VoiceVoxTTSEngine.cs b/SAPIForVOICEVOX/VoiceVoxTTSEngine.cs index 98866c8..83416a0 100644 --- a/SAPIForVOICEVOX/VoiceVoxTTSEngine.cs +++ b/SAPIForVOICEVOX/VoiceVoxTTSEngine.cs @@ -232,23 +232,19 @@ public void Speak(uint dwSpeakFlags, ref Guid rguidFormatId, ref WAVEFORMATEX pW goto SetNextData; } - //XMLタグの抽出 - Regex regex = new Regex(@"<.+?>", RegexOptions.IgnoreCase); - string sentenceExcludedXMLTag = regex.Replace(currentTextList.pTextStart, ""); - if (string.IsNullOrWhiteSpace(sentenceExcludedXMLTag)) - { - goto SetNextData; - } + //指定の範囲抽出 + string text = currentTextList.pTextStart; + text = text.Substring(0, (int)currentTextList.ulTextLen); //分割 string[] splitedString; if (charSeparators.Count() == 0) { - splitedString = new string[] { sentenceExcludedXMLTag }; + splitedString = new string[] { text }; } else { - splitedString = sentenceExcludedXMLTag.Split(charSeparators.ToArray(), StringSplitOptions.RemoveEmptyEntries); + splitedString = text.Split(charSeparators.ToArray(), StringSplitOptions.RemoveEmptyEntries); } foreach (string str in splitedString)