Ejemplo n.º 1
0
        /// <summary>
        /// Handles the TTS-stream of a typed-text. Adds its phonemes to the
        /// 'Expected' list.
        /// </summary>
        /// <param name="StreamNumber"></param>
        /// <param name="StreamPosition"></param>
        /// <param name="Duration"></param>
        /// <param name="NextPhoneId"></param>
        /// <param name="Feature"></param>
        /// <param name="CurrentPhoneId"></param>
        void tts_Phoneme(int StreamNumber,
                         object StreamPosition,
                         int Duration,
                         short NextPhoneId,
                         SpeechVisemeFeature Feature,
                         short CurrentPhoneId)
        {
#if DEBUG
            string ttsinfo = "tts_Phoneme() #" + StreamNumber + " StreamPosition= " + StreamPosition + " PhoneId= " + CurrentPhoneId;
#endif
            if (CurrentPhoneId > 9)             // NOTE: This causes signifiers like silence #7 "_" and nasalvowel #9 "~" to bypass.
            {
                string phon = _phoneConverter.IdToPhone(CurrentPhoneId);
#if DEBUG
                logfile.Log(ttsinfo + " - " + phon);
                logfile.Log(". ADD to Expected");
#endif
                Expected.Add(phon);
            }
#if DEBUG
            else
            {
                logfile.Log(ttsinfo + " - " + _phoneConverter.IdToPhone(CurrentPhoneId));
                logfile.Log(". BYPASS Expected");
            }
            logfile.Log(". Duration= " + Duration);
            logfile.Log(". Feature= " + Feature);
            logfile.Log(". NextPhoneId= " + NextPhoneId);
            logfile.Log(". nextphone= " + _phoneConverter.IdToPhone(NextPhoneId));               // iffy. Can fail silently.
#endif
        }
Ejemplo n.º 2
0
        private void CalculateFeatures(uint reg, FeatureSet featureSet)
        {
            int bitMask = 1;

            for (int i = 0; i < 32; i++)
            {
                if ((reg & bitMask) != 0 && featureSet.Set[i] != null)
                {
                    string regName = featureSet.Set[i];
                    if (regName.Equals(string.Empty))
                    {
                        regName = string.Format("{0}[{1}]", featureSet.Name, i);
                    }
                    Expected.Add(regName);
                }
                bitMask <<= 1;
            }
        }
Ejemplo n.º 3
0
 public void Init(IEnumerable <int> input, IEnumerable <int> expected, string inputText)
 {
     Stack.Clear();
     Registers.Clear();
     for (int i = 0; i < 4; i++)
     {
         Registers.Add(0);
     }
     Input.Clear();
     Expected.Clear();
     Output.Clear();
     foreach (int i in input)
     {
         Input.Add(i);
     }
     foreach (int i in expected)
     {
         Expected.Add(i);
     }
     Status = Status.Running;
     Build(inputText);
 }