SpeechRecognitionAudioCaptureStateChangedEventArgs class
Bing
The SpeechRecognitionAudioCaptureStateChangedEventArgs class communicates the current state of the audio capture operation to the SpeechRecognizer.AudioCaptureStateChanged event.
The SpeechRecognitionAudioCaptureStateChangedEventArgs class has the following members.
Name | Description |
|---|---|
Specifies where the application is in the audio capture process. |
Example
The following code example prints status information to a TextBlock named StatusBar.
var SR; function pageLoaded() { var credentials = new Bing.Speech.SpeechAuthorizationParameters(); credentials.clientId = "<YOUR CLIENT ID>"; credentials.clientSecret = "<YOUR CLIENT SECRET>"; SR = new Bing.Speech.SpeechRecognizer("en-US", credentials); SR.onaudiocapturestatechanged = SR_AudioCaptureStateChanged; } function SR_AudioCaptureStateChanged(sender, args) { switch (args.State) { case SpeechRecognizerAudioCaptureState.Canceled: this.StatusBar.Text = "Operation cancelled."; break; case SpeechRecognizerAudioCaptureState.Cancelling: this.StatusBar.Text = "Cancelling capture operation..."; break; case SpeechRecognizerAudioCaptureState.Complete: this.StatusBar.Text = "Audio capture complete."; break; case SpeechRecognizerAudioCaptureState.Initializing: this.StatusBar.Text = "Initializing audio capture..."; break; case SpeechRecognizerAudioCaptureState.Listening: this.StatusBar.Text = "Listening..."; break; case SpeechRecognizerAudioCaptureState.Thinking: this.StatusBar.Text = "Interpreting audio input..."; break; default: this.StatusBar.Text = "Unknown capture state."; break; } }
Requirements
Minimum Supported Client | Windows 8 |
Required Extensions | Bing.Speech |
Namespace |
Show:
A status field, as in this example, is one way to communicate application status to your users, but visual changes to the control or application window could accomplish the same thing.