internal void HandleOnVoice(object sender, VoiceEventArgs e) { if (OnVoice != null) { OnVoice(this, e); } }
void pm_InterruptionDetected(object o, VoiceEventArgs args) { display("Interruption detected in playing prompt", MessageType.WARNING); }
/// <summary> /// This method is invoked when prompt is completely played. /// </summary> /// <param name="o"></param> /// <param name="args"></param> void pm_Completed(object o, VoiceEventArgs args) { ; }
/// <summary> /// Method fired if some voice error occurs /// </summary> /// <param name="o"></param> /// <param name="args"></param> void ll_VoiceErrorOccurred(object o, VoiceEventArgs args) { display("Listener: Voice Error Occurred. REASON = " + args.Cause.ToString(), MessageType.WARNING); ll.Start(); }
/// <summary> /// Method fired when listener is started /// </summary> /// <param name="o"></param> /// <param name="args"></param> void ll_Started(object o, VoiceEventArgs args) { setState(CurrentState.LISTENER_STARTED); }
/// <summary> /// This method is fired when listener detects speech. /// </summary> /// <param name="o"></param> /// <param name="args"></param> void ll_SpeechDetected(object o, VoiceEventArgs args) { calleeData.speechDetectionTime = DateTime.Now; setState(CurrentState.SPEECH_DETECTED); }
/// <summary> /// Method fired if some voice error occurs /// </summary> /// <param name="o"></param> /// <param name="args"></param> void ll_VoiceErrorOccurred(object o, VoiceEventArgs args) { Trace.WriteLine("Listener: Voice Error Occurred. REASON = " + args.Cause.ToString() + " Current time = " + DateTime.Now, "Info"); ll.Start(); }
void recorder_Completed(object sender, VoiceEventArgs args) { RecorderEventArgs recorderArgs = args as RecorderEventArgs; display("Recorder completed event received. Duration of recorded file = " + recorderArgs.Duration.ToString()); }
void recorder_Started(object sender, VoiceEventArgs args) { display("Recording started"); }
void recorder_VoiceErrorOccurred(object sender, VoiceEventArgs args) { display("Voice Error occurred in recorder " + args.Cause.ToString()); }
/// <summary> /// Event handler fired when some error occurs in prompt playing /// </summary> /// <param name="o"></param> /// <param name="args"></param> void pm_VoiceErrorOccurred(object o, VoiceEventArgs args) { /** * Some error occurred in playing the prompt. Thus, we enable the timer so that the call can * be disconnected in the duration specified with the timer. */ callDurationTimer.Enabled = true; int temp; lock (this) { temp = numCallsPlaced; } Trace.TraceWarning("Prompt: Voice Error Occurred in Iteration " + temp + " Current time = " + DateTime.Now); }
/// <summary> /// Method invoked when prompt is being played. Store the time when prompt was started and change status. /// Also send result of this iteration. /// </summary> /// <param name="o"></param> /// <param name="args"></param> void pm_Started(object o, VoiceEventArgs args) { callerData.speakTime = DateTime.Now; ///** // * Once prompt has started to be played, we disable the timer used to release the call and enable only // * if voice error event is received for the prompt. // */ //callDurationTimer.Enabled = false; setState(CurrentState.PLAYING_PROMPT); }
/// <summary> /// Event handler fired when prompt playing is completed. /// </summary> /// <param name="o"></param> /// <param name="args"></param> void pm_Completed(object o, VoiceEventArgs args) { // Since prompt playing is completed, we re-enable the call duration timer so that the call will be // released eventually // callDurationTimer.Interval = 20000; callDurationTimer.Enabled = true; }
/// <summary> /// This method is invoked when prompt just starts to be played. At this time, we store /// the current time as the time when prompt was being played. /// </summary> /// <param name="o"></param> /// <param name="args"></param> void pm_Started(object o, VoiceEventArgs args) { calleeData.speakTime = DateTime.Now; setState(CurrentState.PLAYING_PROMPT); }
public void PluginsOnVoice(object sender, VoiceEventArgs e) { OnVoice(this, e); }
void pm_VoiceErrorOccurred(object o, VoiceEventArgs args) { display("Voice error occurred in prompt", MessageType.WARNING); }
void ll_SilenceTimeoutExpired(object o, VoiceEventArgs args) { Trace.WriteLine("Silence timeout expired. Restarting Listener", "Info"); ll.Start(); }
void mClient_OnVoice(object sender, VoiceEventArgs e) { AddText(string.Format("*** {0} voiced {1}", e.Who, e.Whom)); UpdateNames(); }
/// <summary> /// This method is fired when listener detects speech. It waits for random amount of time and /// then plays the selected prompt. /// </summary> /// <param name="o"></param> /// <param name="args"></param> void ll_SpeechDetected(object o, VoiceEventArgs args) { DateTime spDetTime = DateTime.Now; int sleepTime; DateTime uninitDate = new DateTime(); // Once speech is detected, we disable the call duration timer. In case prompt can't be played (VoiceEvent error) // is received or when prompt playing gets completed, we enable the timer to ensure that the call gets disconnected. callDurationTimer.Enabled = false; /* * On detecting speech, the caller must barge-in (i.e. play a prompt after waiting a random time). * Since caller can detect its own echoes, it is necessary to ensure that the caller only barges in the first time * This is why, the caller's speak time is checked to see if the caller played a prompt once or not. */ if (callerData.speechDetectionTime == uninitDate) { callerData.speechDetectionTime = DateTime.Now; // Wait for random number of seconds and then speak on the channel sleepTime = randomGenerator.Next(minSpeechBargeTime, maxSpeechBargeTime); if (sleepTime > 0) { bargeTimer.Interval = sleepTime * 1000; // To convert to milli-sec bargeTimer.Enabled = true; } else { playPrompt(); } } setState(CurrentState.SPEECH_DETECTED); }