Welcome to GotSpeech.NET Sign in | Join | Help

Using speechControlSettingsItem in the Web.config

I recently worked on an MSS 2004 R2 project where I wanted to put all the speech configuration into a single location.  When I say speech configuration items I am talking about bargein, rejection, confirmation levels, etc.  There seems to be plenty of explaination of how to put SpeechControlSettings inside your .aspx file and speech control properties but not much on how to use SpeechControlSettings inside your Web.config.  This blog post is going to try to document this a little more.

 

I try to put all the speech related configuration inside my Web.config because it separates the presentation from the configuration.  Also, I could see myself creating a neat little utility to be able to edit the web.config parameters at a later date (That would be a dream anybody else do this?)

 

For each QA that you would like to setup an associated SpeechControlSettings there is a public property called Settings.  Set this property to a value that makes sense to you.  In my example I choose IntroMsgSettings.  I tried to use a naming convention of [QAName]Settings.

 

In the .aspx page:

 

<speech:QA id="IntroMsg" runat="server" Settings="IntroMsgSettings">
   <Prompt PromptSelectFunction="PromptFunction" ID="IntroMsg_Prompt"/>
</speech:QA>

Now here is where I have trouble finding the documentation on what to put in the Web.Config.  Place a speechControlSettingsItem section for each Settings ID that you have in your .aspx page.  The syntax is very similar if you were to have used the .aspx method but it follows a camel case syntax.  The following example turns bargeIn set to true for the IntroMsg QA.

 

In Web.config (after </system.web>):

 

<speechControlSettings>
   <speechControlSettingsItem id="IntroMsgSettings">
      <qa>
         <prompt bargeIn="true" />
      </qa>
   </speechControlSettingsItem>
</speechControlSettings>

Here is another example of a simple QA that retrieves a phone number.

 

In the .aspx page:

 

<speech:QA id="GetPhone" runat="server" Settings="GetPhoneSettings">
   <Answers>
      <speech:Answer SemanticItem="PhoneNumber" XpathTrigger="/SML/phoneNumber"/>
   </Answers>
   <Reco ID="GetANIPhone_Reco">
      <Grammars>
         <speech:Grammar Src="Grammars/phoneNumber.grxml" ID="GetANIPhone_Grammar1"/>
      </Grammars>
   </Reco>
   <Prompt PromptSelectFunction="PromptFunction" ID="GetPhone_Prompt"/>
</speech:QA>

Inside the Web.config in the speechControlSettings tag:

 

<speechControlSettingsItem id="GetANIPhoneSettings">
   <qa>
      <prompt bargeIn="true" />
      <answers reject="0.3" confirmThreshold=".7" />
   </qa>
</speechControlSettingsItem>

What I have found best to do is to look at the QAControlSettings Class and use camel case instead of Pascal case to figure out what kind of properties that can be set from the Web.config.

 

Again, what is nice about this is that I have all the speech control configuration in one area that is easy to change on the fly.  This is great when going through tuning and having to tweak certain QA's configuration properties.

Technorati Tags:

Published Tuesday, August 08, 2006 5:08 PM by brandontyler
Filed under:

Comments

# re: Using speechControlSettingsItem in the Web.config

I was reading this http://gotspeech.net/forums/thread/1469.aspx post in our forums and just make sure when you edit the web.config you realize that the session data is blown away.
Tuesday, August 15, 2006 12:40 PM by brandontyler
Anonymous comments are disabled