1

I am developing a C# application based on the Microsoft Speech API. I need to manage static and free text in my application. For example, a user could say "Search file [here free dictation to let the user gives the filename]".

Based on this post (Combine free-form dictation and semantic in a srgs grammar), I tried to use the following grammar:

<grammar version="1.0" xml:lang="fr-fr"  mode="voice" root="toplevel"
xmlns="http://www.w3.org/2001/06/grammar" tag-format="semantics/1.0" >
  <rule id="toplevel" scope="public">
    <ruleref uri="#tmkAction" />
    <ruleref special="GARBAGE"/>
    <ruleref uri="#tmkItemType" />
    <ruleref uri="sapi:dictation" type="application/srgs+xml"/>
    <tag>out.SpokenText=rules.latest();</tag>
  </rule>

But, according to the validator, this grammar file is not correct ("Warning: Could not load external grammar 'grammar:dictation'") and does not work.

does anyone have any idea how mix free text and static grammars in Microsoft Speech Platform?

Thank you

Community
  • 1
  • 1
ltu
  • 169
  • 3
  • 16
  • There is no need to start a new question if the older one is on the same topic. – Nikolay Shmyrev May 22 '14 at 17:35
  • possible duplicate of [Combine free-form dictation and semantic in a srgs grammar](http://stackoverflow.com/questions/10988117/combine-free-form-dictation-and-semantic-in-a-srgs-grammar) – Nikolay Shmyrev May 22 '14 at 17:36
  • It's not the same topic. Dictation support in Microsoft.Speech namespace is new since [Speech Platform SDK 11](http://msdn.microsoft.com/en-us/library/dd266409(v=office.14).aspx). Furthermore, grammar syntax seems to be different between System.Speech and Microsoft.Speech. – Loul G. Jun 16 '14 at 13:21

1 Answers1

0

As you use sapi namespace in the last ruleref tag, what about declaring it first: xmlns:sapi="http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions

This can be a source of information.

I can notice that your error is about grammar:dictation whereas your attribute is sapi:dictation. I think you must make sure that your xml file is well deployed at build.

You should also make sure that you installed Speech SDK Runtime Languages from your culture; the Text To Speech one AND the Speech Recognition one. Here

Loul G.
  • 997
  • 13
  • 27