Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
DtmfRecognitionEngine.AddTone Method
Include Protected Members
Include Inherited Members
Adds a tone to the buffer for recognition against the loaded grammars.
Overload List
Name | Description | |
---|---|---|
AddTone(Byte) | Adds a tone to the buffer for recognition against the loaded Grammar objects. | |
AddTone(DtmfTone) | Adds a tone to the buffer for recognition against the loaded Grammar objects. |
Top
Remarks
Warning
It is possible for a caller to send many simultaneous tones to a DTMF recognition engine which can cause it to take time to process. This processing time can cause the computer that is running the DTMF recognition engine to stop responding in a timely manner, much like a denial of service attack. It is recommended that the application put a limit on the total number of tones sent to a given instance of the DtmfRecognitionEngine class.
// Initialize an instance of the DtmfRecognitionEngine class.
DtmfRecognitionEngine dtmfRecognizer = new DtmfRecognitionEngine();
// Create a Grammar object from a file and load it.
Grammar grammar = new Grammar("C:\\SampleGrammar.xml");
dtmfRecognizer.LoadGrammar(grammar);
// Add some tones.
dtmfRecognizer.AddTone(1);
dtmfRecognizer.AddTone(2);