Example #1
0
        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);
        }
Example #2
0
 protected override void ReadUnknownWord(string word, ISpeechTimeline writer)
 {
 }
Example #3
0
 protected override void ReadUnknownWord(string word, ISpeechTimeline writer)
 {
     throw new NotImplementedException();
 }
Example #4
0
 protected abstract void ReadUnknownWord(string word, ISpeechTimeline writer);