Export (0) Print
Expand All

DtmfRecognitionEngine.AddTone Method

Adds a tone to the buffer for recognition against the loaded grammars.

  NameDescription
Public method AddTone(Byte) Adds a tone to the buffer for recognition against the loaded Grammar objects.
Public method AddTone(DtmfTone) Adds a tone to the buffer for recognition against the loaded Grammar objects.
Top

Caution noteCaution

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);

Show:
© 2014 Microsoft