private void Synth_VisemeReached(object sender, VisemeReachedEventArgs e) { visemeStartTime = currentTime; visemeDuration = (float)e.Duration.TotalSeconds; currentViseme = e.Viseme; nextViseme = e.NextViseme; }
//This method is called from LINKS so it's a seperate thread than the window public void Synthesizer_UpdateSwitch(object sender, VisemeReachedEventArgs e) { if (last_bri == -1) { last_bri = Brightness; } if (lastLightUpdate.AddMilliseconds(9) < DateTime.Now) { if (Global.LINKS_Viseme != null && Global.LINKS_Viseme.IsInitialized) { if (Global.LINKS_Viseme.LSwitch.Equals(LSwitch)) { Console.WriteLine(e.Viseme + " from links."); Console.WriteLine("Synth: " + Global.LINKS_Viseme.LSwitch.Name); this.Dispatcher.BeginInvoke(new Action(delegate { SwitchDimmer(this, e.Viseme); })); lastLightUpdate = DateTime.Now; } } } }
/// <summary> /// Initializes a new instance of the <see cref="VisemeReachedEventData"/> class. /// </summary> /// <param name="e"> /// The event args from the System.Speech.Synthesis.SpeechSynthesizer.VisemeReached event. /// </param> public VisemeReachedEventData(VisemeReachedEventArgs e) { this.Viseme = e.Viseme; this.AudioPosition = e.AudioPosition; this.Duration = e.Duration; this.Emphasis = e.Emphasis; this.NextViseme = e.NextViseme; }
public void synthVisemeReached(object sender, VisemeReachedEventArgs e) { if (e.Viseme != lastViseme) { lastViseme = e.Viseme; MouthPosChangedEventArgs args = new MouthPosChangedEventArgs(); args.Pos = (Convert.ToString(positions[Convert.ToInt32(e.Viseme)])); OnMouthPosChanged(args); } }
public static void Synthesizer_UpdateAnimation(object sender, VisemeReachedEventArgs e) { if (lastLightUpdate.AddMilliseconds(9) < DateTime.Now) { if (Global.LINKS_Viseme != null && Global.LINKS_Viseme.IsInitialized) { Console.WriteLine(e.Viseme + " from links."); Console.WriteLine("Synth: " + ((SwitchView)sender).Title); //LINKS_Viseme.SwitchDimmer(LINKS_Viseme, e.Viseme); lastLightUpdate = DateTime.Now; } } }
/// <summary> /// VisemeReached handler, called by speech synthesizer /// </summary> /// <param name="sender"></param> /// <param name="args"></param> void VisemeReachedHandler(object sender, VisemeReachedEventArgs args) { if (args.Error != null || args.Cancelled) { return; } VisemeNotification notification = new VisemeNotification(); notification.AudioPosition = args.AudioPosition; notification.Duration = args.Duration; notification.Emphasis = args.Emphasis; notification.NextViseme = args.NextViseme; notification.Viseme = args.Viseme; VisemeNotify notify = new VisemeNotify(); notify.Body = notification; SendNotification <VisemeNotify>(_subMgrPort, notify); }
private void OnVisemeReached(object sender, VisemeReachedEventArgs e) { var time = this.pipeline.GetCurrentTime(); this.VisemeReached.Post(new VisemeReachedEventData(e), time); }
//event for triggering lip-synching private void _synthesizer_VisemeReached(object sender, VisemeReachedEventArgs e) { var valueToSend = ConvertViseme(_mouthMap[e.Viseme]); SendPosition(valueToSend); }
private void ProcessViseme(object sender, VisemeReachedEventArgs args) { SpeechClient.SpeechPublisher.Viseme(args.Viseme, args.NextViseme, VisemeToPercent(args.Viseme), VisemeToPercent(args.NextViseme)); }
void _synth_VisemeReached(object sender, VisemeReachedEventArgs e) { System.Diagnostics.Debug.WriteLine(e.ToString()); }
private void SpeechSynthesizer_VisemeReached(object sender, VisemeReachedEventArgs e) { DrawViseme(e.Viseme); }
//event for triggering lip-synching private void _synthesizer_VisemeReached(object sender, VisemeReachedEventArgs e) { var valueToSend = ConvertViseme(_mouthMap[e.Viseme]); SendPosition(valueToSend); }
private void SpeechSynthesizer_VisemeReached(object sender, VisemeReachedEventArgs e) { DrawViseme(e.Viseme); }
private void Synth_VisemeReached(object sender, VisemeReachedEventArgs e) { Console.WriteLine($"Viseme reached: {e.AudioPosition.TotalSeconds} {e.Duration.TotalSeconds} {e.Viseme} {e.NextViseme}"); }