AudioSignalProblemOccurredEventArgs AudioSignalProblemOccurredEventArgs AudioSignalProblemOccurredEventArgs AudioSignalProblemOccurredEventArgs Class

Definizione

Fornisce dati per l'evento AudioSignalProblemOccurred di un elemento SpeechRecognizer o di un elemento SpeechRecognitionEngine.Provides data for the AudioSignalProblemOccurred event of a SpeechRecognizer or a SpeechRecognitionEngine.

public ref class AudioSignalProblemOccurredEventArgs : EventArgs
public class AudioSignalProblemOccurredEventArgs : EventArgs
type AudioSignalProblemOccurredEventArgs = class
    inherit EventArgs
Public Class AudioSignalProblemOccurredEventArgs
Inherits EventArgs
Ereditarietà
AudioSignalProblemOccurredEventArgsAudioSignalProblemOccurredEventArgsAudioSignalProblemOccurredEventArgsAudioSignalProblemOccurredEventArgs

Esempi

Nell'esempio seguente viene definito un gestore eventi che raccoglie informazioni su un AudioSignalProblemOccurred evento.The following example defines an event handler that gathers information about an AudioSignalProblemOccurred event.

  
private SpeechRecognitionEngine sre;  
  
// Initialize the speech recognition engine.  
private void Initialize()  
{  
  sre = new SpeechRecognitionEngine();  
  
  // Add a handler for the AudioSignalProblemOccurred event.  
  sre.AudioSignalProblemOccurred += new EventHandler<AudioSignalProblemOccurredEventArgs>(sre_AudioSignalProblemOccurred);  
}  
  
// Gather information when the AudioSignalProblemOccurred event is raised.  
void sre_AudioSignalProblemOccurred(object sender, AudioSignalProblemOccurredEventArgs e)  
{  
  StringBuilder details = new StringBuilder();  
  
  details.AppendLine("Audio signal problem information:");  
  details.AppendFormat(  
    " Audio level:               {0}" + Environment.NewLine +  
    " Audio position:            {1}" + Environment.NewLine +  
    " Audio signal problem:      {2}" + Environment.NewLine +  
    " Recognition engine audio position: {3}" + Environment.NewLine,  
    e.AudioLevel, e.AudioPosition,  e.AudioSignalProblem,  
    e.RecognizerAudioPosition);  
  
  // Insert additional event handler code here.  
}  
  

Commenti

Un'istanza di AudioSignalProblemOccurredEventArgs viene creata quando l' SpeechRecognitionEngine oggetto SpeechRecognizer o genera un AudioSignalProblemOccurred evento.An instance of AudioSignalProblemOccurredEventArgs is created when the SpeechRecognitionEngine or SpeechRecognizer object raises an AudioSignalProblemOccurred event. Per ottenere informazioni correlate a un AudioSignalProblemOccurred evento, accedere alle proprietà seguenti nel gestore per l'evento:To obtain information related to an AudioSignalProblemOccurred event, access the following properties in the handler for the event:

La AudioPosition proprietà fa riferimento alla posizione del dispositivo di input nel flusso audio generato.The AudioPosition property references the input device's position in its generated audio stream. Al contrario, la RecognizerAudioPosition proprietà fa riferimento alla posizione del riconoscitore all'interno del relativo input audio.By contrast, the RecognizerAudioPosition property references the recognizer's position within its audio input. Queste posizioni possono essere diverse.These positions can be different. Per ulteriori informazioni, vedere utilizzo degli eventi di riconoscimento vocale.For more information, see Using Speech Recognition Events.

La AudioSignalProblem proprietà indica il problema che si è verificato.The AudioSignalProblem property indicates which problem occurred.

AudioSignalProblemOccurredEventArgs deriva da EventArgs.AudioSignalProblemOccurredEventArgs derives from EventArgs.

Proprietà

AudioLevel AudioLevel AudioLevel AudioLevel

Ottiene il livello audio associato all'evento.Gets the audio level associated with the event.

AudioPosition AudioPosition AudioPosition AudioPosition

Ottiene la posizione del flusso audio del dispositivo di input che indica dove il problema si è verificato.Gets the position in the input device's audio stream that indicates where the problem occurred.

AudioSignalProblem AudioSignalProblem AudioSignalProblem AudioSignalProblem

Ottiene il problema del segnale audio.Gets the audio signal problem.

RecognizerAudioPosition RecognizerAudioPosition RecognizerAudioPosition RecognizerAudioPosition

Ottiene la posizione dell'input audio ricevuta dal riconoscimento che indica dove il problema si è verificato.Gets the position in the audio input that the recognizer has received that indicates where the problem occurred.

Metodi

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Funge da funzione hash predefinita.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Ottiene l'oggetto Type dell'istanza corrente.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficiale dell'oggetto Object corrente.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.Returns a string that represents the current object.

(Inherited from Object)

Si applica a

Vedi anche