public void Parse(string phrase, ISpeechTimeline timeline) { Phoneme p; for (int i = 0; i < phrase.Length; i++) { switch (phrase[i]) { case ' ': timeline.AddSilence(0.2); break; default: if (i < phrase.Length - 1 && phrase[i + 1] == '\\') { if ((p = Phoneme.GetPreset($"{phrase[i]}\\")) != null && p.ArticulationPlace == ConsonantPlace.None) { timeline.AddPhoneme(0.4, p.Height, p.Backness, p.Roundedness); } i++; } else { if ((p = Phoneme.GetPreset(phrase[i].ToString())) != null && p.ArticulationPlace == ConsonantPlace.None) { timeline.AddPhoneme(0.4, p.Height, p.Backness, p.Roundedness); } } break; } } timeline.AddSilence(0.2); }
protected override void ReadUnknownWord(string word, ISpeechTimeline writer) { }
protected override void ReadUnknownWord(string word, ISpeechTimeline writer) { throw new NotImplementedException(); }
protected abstract void ReadUnknownWord(string word, ISpeechTimeline writer);