次の方法で共有


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft.Speech.Recognition Namespace

Contains types for implementing recognition of speech and Dual-Tone Multi-Frequency (DTMF) tones.

The Microsoft Speech Platform SDK 11 offers a basic speech recognition infrastructure that digitizes acoustical signals, and recovers words, speech elements from audio input, and also processes DTMF tones.

Applications use the Microsoft.Speech.Recognition namespace to access and extend this basic speech recognition technology by defining algorithms for identifying and acting on specific phrases or word patterns, and by managing the runtime behavior of this speech infrastructure.

Create Grammars

You create grammars, which consist of a set of rules or constraints, to define words and phrases that your application will recognize as meaningful input. Using a constructor for the Grammar class, you can create a grammar object at runtime from GrammarBuilder or SrgsDocument instances, or from a file, a string, or a stream that contains a definition of a grammar.

Using the GrammarBuilder and Choices classes, you can build grammar documents programmatically that do not depend on or conform to the Speech Recognition Grammar Specification 1.0 (SRGS). To create SRGS-compliant grammars programmatically, use the types and members of the Microsoft.Speech.Recognition.SrgsGrammar name space.

See Create Grammars (Microsoft.Speech) in the Microsoft Speech Programming Guide for more information and examples.

Manage Speech Recognition Engines

Instances of SpeechRecognitionEngine provide access to installed recognizers (Runtime Languages) to perform speech recognition. A Runtime Language includes the language model, acoustic model, and other data necessary to provision a speech engine to perform speech recognition in a particular language. See InstalledRecognizers() for more information.

You can use SpeechRecognitionEngine to initialize a speech recognition engine instance, select an installed Runtime Language to use for recognition, load and unload grammars, subscribe to speech recognition events, configure the audio input, start and stop recognition, and modify properties of the speech recognition engine that affect recognition.

See Initialize and Manage a Speech Recognition Engine (Microsoft.Speech) in the Microsoft Speech Programming Guide for more information.

The DtmfRecognitionEngine class provides control over engines that recognize DTMF tones.

Respond to Events

SpeechRecognitionEngine objects generate events in response to audio input to the speech recognition engine. The AudioLevelUpdated, AudioSignalProblemOccurred, AudioStateChanged events are raised in response to changes in the incoming signal. The SpeechDetected event is raised when the speech recognition engine identifies incoming audio as speech. The speech recognition engine raises the SpeechRecognized event when it matches speech input to one of its loaded grammars, and raises the SpeechRecognitionRejected when speech input does not match any of its loaded grammars.

Other types of events include the LoadGrammarCompleted event which a speech recognition engine raises when it has loaded a grammar.

The DtmfRecognitionEngine generates a similar set of events, but in response to receiving DTMF tones, rather than speech, as input.

You can register to be notified for events that the speech recognition engine raises and create handlers using the EventsArgs classes associated with each of these events to program your application's behavior when an event is raised.

See Use Speech Recognition Events (Microsoft.Speech) in the Microsoft Speech Programming Guide for more information.

Classes

  Class Description
Public class AudioLevelUpdatedEventArgs Provides data for the AudioLevelUpdated event.
Public class AudioSignalProblemOccurredEventArgs Provides data for the AudioSignalProblemOccurred event.
Public class AudioStateChangedEventArgs Provides data for the AudioStateChanged event of the SpeechRecognitionEngine class.
Public class Choices Represents a list of alternative items to make up an element in a grammar.
Public class DtmfHypothesizedEventArgs Provides data for the DtmfHypothesized event.
Public class DtmfRecognitionEngine Provides access to DTMF recognition services.
Public class DtmfRecognitionRejectedEventArgs Provides data for the DtmfRecognitionRejected event.
Public class DtmfRecognizeCompletedEventArgs Returns information from the RecognizeCompleted event.
Public class DtmfRecognizedEventArgs Provides data for the DtmfRecognized event.
Public class EmulateRecognizeCompletedEventArgs Provides data for the EmulateRecognizeCompleted event.
Public class Grammar A run-time object that references a speech recognition grammar, which an application can use to define the constraints for speech recognition.
Public class GrammarBuilder Provides a mechanism for programmatically building the constraints for a speech recognition grammar.
Public class GrammarInfo Represents an object that contains static information about a speech recognition grammar. In contrast, a Grammar object contains information about a speech recognition grammar that is loaded into a speech recognizer at run time.
Public class GrammarInfoPartsCollection Represents a collection of speech recognition engine parts.
Public class InvalidCultureException Thrown when a recognizer attempts to reference a grammar that specifies an unsupported or uninstalled language.
Public class LoadGrammarCompletedEventArgs Provides data for the LoadGrammarCompleted event.
Public class RecognitionEventArgs Provides information about speech recognition events.
Public class RecognitionResult Contains detailed information about input that was recognized by instances of SpeechRecognitionEngine or DtmfRecognitionEngine.
Public class RecognizeCompletedEventArgs Provides data for the RecognizeCompleted event.
Public class RecognizedAudio Represents audio input that is associated with a RecognitionResult.
Public class RecognizedPhrase Contains detailed information, generated by the speech recognition engine, about the recognized input.
Public class RecognizedWordUnit Provides the atomic unit of recognized speech.
Public class RecognizerInfo Represents information about a SpeechRecognitionEngine object.
Public class RecognizerUpdateReachedEventArgs Provides data for the RecognizerUpdateReached event.
Public class ReplacementText Contains information about a speech normalization procedure that has been performed on recognition results.
Public class SemanticResultKey Associates a key string with SemanticResultValue values to define the SemanticValue objects.
Public class SemanticResultValue Represents a semantic value and optionally associates the value with a component of a speech recognition grammar.
Public class SemanticValue Represents the semantic organization of a recognized phrase.
Public class SpeechDetectedEventArgs Provides data for the SpeechDetected event.
Public class SpeechHypothesizedEventArgs Infrastructure. Provides data for the SpeechHypothesized event.
Public class SpeechRecognitionEngine Provides the means to access and manage a speech recognition engine.
Public class SpeechRecognitionRejectedEventArgs Provides information for the SpeechRecognitionRejected event.
Public class SpeechRecognizedEventArgs Provides information for the Grammar.SpeechRecognized and SpeechRecognitionEngine.SpeechRecognized events.

Enumerations

  Enumeration Description
Public enumeration AudioSignalProblem Contains a list of possible problems in the audio signal coming in to a speech recognition engine.
Public enumeration AudioState Contains a list of possible states for the audio input to a speech recognition engine.
Public enumeration DisplayAttributes Lists the options that the SpeechRecognitionEngine object can use to specify white space for the display of a word or punctuation mark.
Public enumeration DtmfTone Enumerates values of the first 16 DTMF tones.
Public enumeration EmulateOptions Specifies the type of recognition operation that is performed by EmulateRecognize() and EmulateRecognizeAsync() methods that take this object as a parameter.
Public enumeration Pronounceable Lists values that represent whether the SpeechRecognitionEngine can pronounce a word and whether the pronunciation is defined in a lexicon.
Public enumeration RecognizeMode Enumerates values of the recognition mode.
Public enumeration SubsetMatchingMode Enumerates values of subset matching mode.