AddTone Method

Microsoft Speech Platform SDK 11

Collapse imageExpand ImageCopy imageCopyHover image

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

Overload List

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

Remarks

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.

 Copy imageCopy Code
// 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);

See Also