void voice_Viseme(int StreamNumber, object StreamPosition, int Duration, SpeechVisemeType NextVisemeId, SpeechVisemeFeature Feature, SpeechVisemeType CurrentVisemeId)
 {
     if (lastVisemeId != (int)CurrentVisemeId)
     {
         visemes.Add(new Viseme(lastVisemeId = (int)CurrentVisemeId, (int)((Decimal)StreamPosition)));
     }
     //Console.WriteLine(string.Format("Viseme event received: {0} {1} {2} {3} {4} {5}", i, o, i2, t, f, t2));
 }
        void voice_Viseme(int StreamNumber, object StreamPosition, int Duration, SpeechVisemeType NextVisemeId, SpeechVisemeFeature Feature, SpeechVisemeType CurrentVisemeId)
        {
            if (lastVisemeId!=(int)CurrentVisemeId)
                visemes.Add(new Viseme(lastVisemeId = (int)CurrentVisemeId, (int)((Decimal)StreamPosition)));

            //Console.WriteLine(string.Format("Viseme event received: {0} {1} {2} {3} {4} {5}", i, o, i2, t, f, t2));
        }
Example #3
0
 protected void spVoice_Viseme(int streamNumber, object streamPosition, int duration, SpeechVisemeType nextViseme, SpeechVisemeFeature feature, SpeechVisemeType currentViseme)
 {
     if (VisemeUpdated != null)
     {
         var msg = new StringMessageEventArgs();
         msg.Message = Convert.ToInt32(currentViseme).ToString() + "," + duration.ToString();
         VisemeUpdated(this, msg);
     }
 }
Example #4
0
 void voice_Viseme(int StreamNumber, object StreamPosition, int Duration, SpeechVisemeType NextVisemeId, SpeechVisemeFeature Feature, SpeechVisemeType CurrentVisemeId)
 {
     conductor.SetState(conductor.CreateStateFromViseme((int)CurrentVisemeId));
 }
Example #5
0
 void voice_Viseme(int StreamNumber, object StreamPosition, int Duration, SpeechVisemeType NextVisemeId, SpeechVisemeFeature Feature, SpeechVisemeType CurrentVisemeId)
 {
     conductor.SetState(conductor.CreateStateFromViseme((int)CurrentVisemeId));
 }
Example #6
0
        private void Voice_Viseme(int StreamNumber, object StreamPosition, int Duration, SpeechVisemeType NextVisemeId, SpeechVisemeFeature Feature, SpeechVisemeType CurrentVisemeId)
        {
            if (ShowAllEventsCheck.Checked)
            {
                AddEventMessage("Viseme: Duration = " + Duration.ToString() +
                                ", NextVisemeId = " + NextVisemeId.ToString() +
                                ", Feature = " + Feature.ToString() +
                                ", CurrentVisemeId = " + CurrentVisemeId.ToString());
            }

            // Show some mouth animation, though this is not
            // really accurate.
            int[]    visemeMap = { 0, 11, 11, 11, 10, 11, 9, 2, 13, 9, 12, 11, 9, 3, 6, 7, 8, 5, 4, 7, 9, 1 };
            int      index;
            Graphics g = Graphics.FromImage(MouthPicture.Image);

            g.Clear(Color.Transparent);
            g.DrawImage(MicImages.Images[0], new Point(0, 0));
            index = visemeMap[Convert.ToInt32(CurrentVisemeId)];
            g.DrawImage(MicImages.Images[index], new Point(0, 0));
            if (index % 6 == 2)
            {
                g.DrawImage(MicImages.Images[14], new Point(0, 0));
            }
            if (index % 6 == 5)
            {
                g.DrawImage(MicImages.Images[13], new Point(0, 0));
            }
            MouthPicture.Invalidate();
        }