Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I load a Grammar xml file that uses SAPI 5.3 tags?
    primarykey
    data
    text
    <p>My question is how can I load a grammar file that uses the tags they list in the MSDN docs? I want to use the format tags that are documented in MSDN under the heading Grammar Format Tags (SAPI 5.3). </p> <p><a href="http://msdn.microsoft.com/en-us/library/ms723634(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms723634(VS.85).aspx</a></p> <p>There it lists tags like DEFINE, LIST, OPT etc. However whenever I try to use those tags in the grammar.xml file I get an error saying that that tag is not supported.</p> <p>If use a grammar file that only uses the tags one-of, item, etc. That are listed here in the MSDN; the grammar file loads.</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms870140.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms870140.aspx</a> </p> <p>I know it is probably something simple but I cant seem to figure it out... </p> <p>Grammar file...that works</p> <pre><code> &lt;grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="command"&gt; &lt;rule id="command" scope="public"&gt; &lt;one-of&gt; &lt;item&gt;nail&lt;/item&gt; &lt;item&gt;hammer&lt;/item&gt; &lt;item&gt;saw&lt;/item&gt; &lt;/one-of&gt; &lt;/rule&gt; &lt;/grammar&gt; </code></pre> <p>Code listing-------------------</p> <pre><code> public Form1() { InitializeComponent(); // set up the recognizer _speechRecognizer = new SpeechRecognizer(); _speechRecognizer.Enabled = false; _speechRecognizer.SpeechRecognized += new EventHandler&lt;SpeechRecognizedEventArgs&gt;(_speechRecognizer_SpeechRecognized); // set up the command and control grammar Grammar commandGrammar = new Grammar(@"grammar.xml"); commandGrammar.Name = "main command grammar"; commandGrammar.Enabled = true; // activate the command grammer _speechRecognizer.LoadGrammar(commandGrammar); _speechRecognizer.Enabled = true; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload