Esempio n. 1
0
 //given a thing, say it
 public void SpeakThing(ModuleUKS2 UKS, Thing t)
 {
     talking = true;
     if (t.Parents[0] == UKS.Labeled("Text"))
     {
         for (int i = 0; i < t.References.Count; i++)
         {
             Thing t1   = t.References[i].T;
             Thing tOut = new Thing();
             ExpandToClass(tOut, t1, UKS.Labeled("Phoneme"));
             //                    tOut.References = tOut.References.GetRange(2000, 200);
             UKS.Play(tOut);
         }
     }
     else
     {
         Thing tOut = new Thing();
         ExpandToClass(tOut, t, UKS.Labeled("Phoneme"));
         UKS.Play(tOut);
     }
 }
Esempio n. 2
0
        private void SpeakPhrase(ModuleUKS2 UKS)
        {
            List <Thing> wordsToSpeak = UKS.AnyChildrenFired(UKS.Labeled("Word"), 1, 0, false, true);

            if (wordsToSpeak.Count == 1)
            {
                UKS.Play(wordsToSpeak[0]);
                talking = true;
            }
            wordsToSpeak = UKS.AnyChildrenFired(UKS.Labeled("Phrase"), 1, 0, false, true);
            if (wordsToSpeak.Count == 1)
            {
                SpeakThing(UKS, wordsToSpeak[0]);
            }
        }