コード例 #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);
        }
コード例 #2
0
ファイル: EnglishUS.cs プロジェクト: mrsagile/Sagen
 protected override void ReadUnknownWord(string word, ISpeechTimeline writer)
 {
 }
コード例 #3
0
 protected override void ReadUnknownWord(string word, ISpeechTimeline writer)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
 protected abstract void ReadUnknownWord(string word, ISpeechTimeline writer);