<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Robert Lucero's Testing Blog</title><link>http://blogs.msdn.com/b/rlucero/</link><description>Thoughts on Software Testing, Development and the Technologies I work on</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Thoughts on Testing - Don’t Duplicate Code!</title><link>http://blogs.msdn.com/b/rlucero/archive/2012/05/18/thoughts-on-testing-don-t-duplicate-code.aspx</link><pubDate>Fri, 18 May 2012 17:16:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10306869</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10306869</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2012/05/18/thoughts-on-testing-don-t-duplicate-code.aspx#comments</comments><description>&lt;p&gt;Here at Microsoft, the majority of our engineering groups are broken down into test development teams and product development teams.&amp;#160; Generally the test teams develop test frameworks and test cases to validate functionality of products.&amp;#160; Developers are usually responsible for unit and method based tests.&amp;#160; Often times, these teams end up writing very similar test frameworks and to some extent duplicate functionality in code.&amp;#160; The old adage, Great Minds Think Alike, applies here but unfortunately teams are unknowingly duplicating each other’s work.&amp;#160; Here’s an approach to unifying the work and getting both teams on the same page.&lt;/p&gt;  &lt;h1&gt;Step 1 - Talk to the Testers and Talk to the Developers!&lt;/h1&gt;  &lt;p&gt;Talk about what you’re testing.&amp;#160; If you’re a developer, meet with the test team to share your test design strategy.&amp;#160; Get the unit test plan and unit test tools reviewed.&amp;#160; If you’re a tester, get the test framework reviewed by the development team.&amp;#160; Highlight points where you can share code and how you plan on using the product code.&amp;#160; &lt;/p&gt;  &lt;p&gt;By talking, teams get on the same page for what work is being done and what is already covered.&amp;#160; The last thing engineering teams need to do is waste time running duplicate tests or changing duplicate code during crunch mode!&lt;/p&gt;  &lt;h1&gt;Step 2 - Draw the Boundaries&lt;/h1&gt;  &lt;p&gt;Meet as an engineering team and make sure that each group knows what test features they’re developing.&amp;#160; If the development team is building a system of mock objects for their unit tests, the test team should use them.&amp;#160; If the test team is developing an in-depth logger, the developers should use it instead of some other solution.&amp;#160; If it is clear who is developing each component and there’s a dependency the amount of duplication should be minimized.&amp;#160; Test code is often thought of after the fact, especially during busy development cycles.&amp;#160; Teams need to get together and work together so that the test infrastructure that is being developed solves both dev and test needs.&lt;/p&gt;  &lt;p&gt;This also applies to what tests engineers are writing.&amp;#160; If the developers are writing more functional tests, testers can write more edge case or scenario tests.&amp;#160; When the ownership is clear, teams can quickly determine the test coverage of their product and similar tests aren’t being simultaneously being written and executed.&lt;/p&gt;  &lt;h1&gt;Step 3 - Work Together!&lt;/h1&gt;  &lt;p&gt;Remember to that the end goals of the engineering team is to ship and awesome product.&amp;#160; People work really hard and focus on the actual product code, but remembering to work together on the test infrastructure will help teams meet their goal.&amp;#160; Again, talk about test development as an important part of the development cycle.&amp;#160; Get test code and test projects treated like the product.&amp;#160; By talking about the test code, working on the test code and running tests as a team you can minimize the amount of duplication that happens.&amp;#160; &lt;/p&gt;  &lt;h1&gt;Summary&lt;/h1&gt;  &lt;p&gt;Duplicating test code can be costly and unnecessary.&amp;#160; By working together and getting people vested in the test infrastructure, teams will have more reliable test frameworks and hopefully higher quality code!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10306869" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/test/">test</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/testing/">testing</category></item><item><title>Quick Aside on XML - The Wrong Way to Use XML</title><link>http://blogs.msdn.com/b/rlucero/archive/2012/04/12/quick-aside-on-xml-the-wrong-way-to-use-xml.aspx</link><pubDate>Wed, 11 Apr 2012 23:35:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10292889</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10292889</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2012/04/12/quick-aside-on-xml-the-wrong-way-to-use-xml.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2" face="Calibri"&gt;XML is a great way to collect and author data in a way that can be consumed by any number of applications.&amp;#160; There are some exceptionally powerful tools that can consume XML formats and enforce levels of data validation, but this is only useful if the implementation make sense.&amp;#160; After working on some legacy tools and trying to design some new test systems, I’ve realized that there’s a right way to use XML and a horribly wrong way to use XML.&lt;/font&gt;&lt;/p&gt;  &lt;h1&gt;Wrong Way #1: Parsing XML With XElement&lt;/h1&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Don’t get me wrong, XELement/XPath searching is a great way to look through XML when you’re just trying to retrieve specific values from generic XML files.&amp;#160; &lt;br /&gt;For Example:      &lt;br /&gt;I want to find every instance within 10 types of XML files where server value is IIS6.0 and change it IIS8.0.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;XElement and XPath can quickly search through the XML files regardless of their structure (provided that they are valid XML files) and change those values.&amp;#160; But, the limitations of this solution are that your searching through the files generically and you’re treating XML as just a structured input type.&amp;#160; In addition, it just doesn’t scale.&amp;#160; Even with fancy regex/XPath queries you can only do so much.&lt;/font&gt;&lt;/p&gt;  &lt;h1&gt;Wrong Way #2: Manually Translating XML to Objects&lt;/h1&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Another quick fix solution I’ve seen implemented a number of times is using Wrong Way #1 to build up an object by hand.&amp;#160; First you create the object that you’re trying to build, then you populate the values of the object by reading values and setting them.&amp;#160; At this point, any way of extracting information from a file is just as good.&amp;#160; The one slight advantage of XML is that the APIs available can help query values.&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;This pattern’s translation layer can also lend itself to maintenance challenges because of written out step-by-step translation from XML document to object.&amp;#160; It also makes it hard to enforce an object-XML document mapping when the translation occurs.&amp;#160; The differences between the XML format or object changes are obscured by the translation layer:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/1715.image_5F00_3F536D9B.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/4442.image_5F00_thumb_5F00_4A10C4F0.png" width="445" height="180" /&gt;&lt;/a&gt;    &lt;br /&gt;&lt;em&gt;Figure 1: Don’t Do This.&lt;/em&gt;&lt;/p&gt;  &lt;h1&gt;Wrong Way #3: Never Using a Schema&lt;/h1&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;If you’ve taken the time to plan out your XML document layout and designing an object model for how you’re going to use all that sweet XML data, you’ve probably also created a schema.&amp;#160; So, use it!&amp;#160; Schemas that are loaded into editors, like Visual Studio, can make manual authoring of XML much faster.&amp;#160; In addition, if you enforce your schema at document load time, you can ensure that you’re only loading documents that the system can handle.&lt;/font&gt;&lt;/p&gt;  &lt;h1&gt;XML Done Right&lt;/h1&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;First, design the object model first.&amp;#160; The important logic is going to work with objects not with XML files or random values pulled from the file.&amp;#160; Make it strongly typed and serializable.&amp;#160; The people consuming your data will appreciate you for it.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Second, let the &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;XmlSerializer&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Calibri"&gt; do the translation work for you.&amp;#160; It won’t mess up with misspelled node names or incorrect value translations (most of the time).&amp;#160; The benefit of this model is that when you want to save the object state all you have to do is deserialize the object out to a file.&amp;#160; Done.&amp;#160; An XML file is saved and available for later.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Third, with the object model in hand you can quickly create a schema.&amp;#160; Again, with this schema you can enforce validation at load time and use the schema to get XML Intellisense when hand editing XML files.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Hopefully by planning your XML/Object model with these tips in hand, you can save yourself a lot of trouble in maintenance and helpful in feature design.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/2451.image_5F00_42F18878.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/2474.image_5F00_thumb_5F00_17ACF171.png" width="493" height="200" /&gt;&lt;/a&gt;    &lt;br /&gt;&lt;em&gt;Figure 2: Do This&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10292889" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/c_2300_/">c#</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/test/">test</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/xml/">xml</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/practices/">practices</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/patterns+and+practices/">patterns and practices</category></item><item><title>Quick Aside on C# - Reflection’s Power and Pitfalls</title><link>http://blogs.msdn.com/b/rlucero/archive/2012/03/08/quick-aside-on-c-reflection-s-power-and-pitfalls.aspx</link><pubDate>Thu, 08 Mar 2012 22:27:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10280045</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10280045</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2012/03/08/quick-aside-on-c-reflection-s-power-and-pitfalls.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2" face="Calibri"&gt;I am currently developing a couple of internal test tools to help with test case development and test case data analysis.&amp;#160; I have designed the tool to be generic, meaning that anybody that can create and serialize objects for me I can edit.&amp;#160; Here are some of the interesting issues I’ve run into so far…&lt;/font&gt;&lt;/p&gt;  &lt;h1&gt;C# Reflection Tip 1:&amp;#160; Reflecting Over Enumerable Properties&lt;/h1&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Suppose someone gives me this object to reflect through:&amp;#160;&amp;#160; &lt;/font&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;pre class="code"&gt;&lt;font face="Lucida Console"&gt;&lt;font size="2"&gt;&lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Demo
&lt;/span&gt;{
    &lt;span style="color: blue;"&gt;public int &lt;/span&gt;Number = 1;
    &lt;span style="color: blue;"&gt;public &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Foo&lt;/span&gt;[] FooArray
    {
        &lt;span style="color: blue;"&gt;get&lt;/span&gt;;
        &lt;span style="color: blue;"&gt;set&lt;/span&gt;;
    }
}&lt;/font&gt;&lt;/font&gt;
&lt;/pre&gt;

&lt;p&gt;&lt;font size="2" face="Calibri"&gt;I want to loop through and display all of the objects contained within the nested array.&amp;#160; If you take the standard approach of reflecting through the Demo object’s types and collecting those types’ properties you’ll see something interesting.&amp;#160; On the first pass of displaying the object, the type property for the &lt;span style="color: rgb(43, 145, 175);"&gt;Foo&lt;/span&gt;[] array is the strongly typed array object.&amp;#160; Everything is fine when looping through the strongly typed elements of the array.&amp;#160; &lt;/font&gt;&lt;/p&gt;
&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;

&lt;p&gt;&lt;font size="2" face="Calibri"&gt;Example:&lt;/font&gt;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;font face="Lucida Console"&gt;&lt;font size="2"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Type &lt;/span&gt;objType = testObject.GetType();
&lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;PropertyInfo&lt;/span&gt;&amp;gt; objProperties = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;PropertyInfo&lt;/span&gt;&amp;gt;(objType.GetProperties());
          
&lt;span style="color: blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;PropertyInfo &lt;/span&gt;property &lt;span style="color: blue;"&gt;in &lt;/span&gt;objProperties)
 {
 …&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;&lt;font size="2" face="Calibri"&gt;But, if the original object has been modified, even with data binding,&amp;#160; it seems that there is a high probability that following the same method yields different results.&amp;#160; Instead of the type property of the &lt;span style="color: rgb(43, 145, 175);"&gt;Foo&lt;/span&gt;[] array being strongly typed, you’ll see all of the &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.array.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;weakly typed Array properties&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Calibri"&gt; like SyncRoot, LongLength, IsSynchronized, etc.&amp;#160; Now instead of displaying a clean list of Foo objects, I instead was displaying the base Array properties in the tool.&lt;/font&gt;&lt;/p&gt;
&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;

&lt;p&gt;&lt;font size="2" face="Calibri"&gt;The way to fix this is by sort of 'preempting’ the fact that this is an array or enumerable collection.&amp;#160; If I could recognize that this was an enumerable object, I would skip right ahead to looping through the nested objects like so:&lt;/font&gt;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;font face="Lucida Console"&gt;&lt;font size="2"&gt;&lt;span style="color: blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Object &lt;/span&gt;obj &lt;span style="color: blue;"&gt;in &lt;/span&gt;(item.GenericObject &lt;span style="color: blue;"&gt;as &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;IEnumerable&lt;/span&gt;))&lt;/font&gt;&lt;/font&gt;
&lt;/pre&gt;

&lt;pre class="code"&gt;&lt;font size="2" face="Calibri"&gt;Now, I can follow the same reflection probing patterns to show all of the nested object.&lt;/font&gt;&lt;/pre&gt;
&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;

&lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;font size="2"&gt;Visual Studio makes this issue hard to track down. While debugging, I put watches on the objects that I was expecting to loop through. The problem is that Visual Studio is too smart some times.&amp;#160; What the debugger shows is the strongly typed object, even though its ethereal/intermediate form might be recognized by the runtime as a weakly typed generic array.&lt;/font&gt;&amp;#160; &lt;/font&gt;&lt;/p&gt;

&lt;h1&gt;C# Reflection Tip 2:&amp;#160; Don’t Forget That Strings Are Enumerable&lt;/h1&gt;

&lt;p&gt;&lt;font size="2" face="Calibri"&gt;Once I solved my generic array problem, I found that there were instances where I was displaying lots of garbage UI data that looked like it was coming from an array or collection.&amp;#160; Again, after further investigation I found out that strings were tripping up my IsEnumerable alarm.&lt;/font&gt;&lt;/p&gt;
&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;

&lt;p&gt;&lt;font size="2" face="Calibri"&gt;Here’s my check for determining if an object’s inherited interface contains IEnumerable as well as screening out strings:&lt;/font&gt;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;font face="Lucida Console"&gt;&lt;font size="2"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Type&lt;/span&gt;[] interfaces = testObject.GetType().GetInterfaces();
&lt;span style="color: blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Type &lt;/span&gt;i &lt;span style="color: blue;"&gt;in &lt;/span&gt;interfaces)
{
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(i.IsGenericType &amp;amp;&amp;amp; i.GetGenericTypeDefinition().Equals(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;IEnumerable&lt;/span&gt;&amp;lt;&amp;gt;)) &amp;amp;&amp;amp; i != &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt;))
        {
              &lt;span style="color: blue;"&gt;return true&lt;/span&gt;;
        }
}&lt;/font&gt;&lt;/font&gt;
&lt;/pre&gt;

&lt;p&gt;&lt;font size="2" face="Calibri"&gt;This can probably be done better, but it works for now.&lt;/font&gt;&lt;/p&gt;

&lt;h1&gt;C# Reflection Tip 3:&amp;#160; Use The Visual Studio Debugger&lt;/h1&gt;

&lt;p&gt;&lt;font size="2" face="Calibri"&gt;The Visual Studio Debugger and Immediate Window are invaluable tools for any sort of reflection based project.&amp;#160; Putting watches on the objects and running GetProperty() and GetType() checks in the immediate window can help you quickly determine where you’re code’s gone wrong.&amp;#160; On occasion, it will lead you astray (See Tip #1), but for the most part the debugging environment will expose other internals and values that will help push the project along.&amp;#160; &lt;/font&gt;&lt;/p&gt;
&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;

&lt;p&gt;&lt;font size="2" face="Calibri"&gt;Scott Guthrie’s &lt;/font&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2010/08/18/debugging-tips-with-visual-studio-2010.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;blog post on debugging tips&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Calibri"&gt; is a great primer to using the debugger for these sorts of tasks.&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10280045" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/managed/">managed</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/c_2300_/">c#</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/debugging/">debugging</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/reflection/">reflection</category></item><item><title>Thoughts on Testing - Breaking Down the Test Plan</title><link>http://blogs.msdn.com/b/rlucero/archive/2012/02/22/thoughts-on-testing-breaking-down-the-test-plan.aspx</link><pubDate>Wed, 22 Feb 2012 16:05:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10271089</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10271089</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2012/02/22/thoughts-on-testing-breaking-down-the-test-plan.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2" face="Calibri"&gt;Test plans, or test specs, are designed to share with a product team exactly what a tester plans on covering to ensure that their feature is ready to ship to customers.&lt;/font&gt;&amp;#160; &lt;/p&gt;  &lt;h3&gt;Problem 1: Who Is the Test Plan For?&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Thinking about who the test plan is for can greatly influence the results of what comes out of the actual document.&amp;#160; There are usually a bunch of vested parties such as developers, program managers, peer testers, test managers, test vendors, sustained engineering teams and security experts just to name a few.&amp;#160; Each one is looking for something different out of the test plan document.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Here’s a breakdown of the lifetime of a test spec and who cares about at each milestone:&lt;/font&gt;&lt;/p&gt;  &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;  &lt;div style="list-style-type: disc; direction: ltr;"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;    &lt;table style="border: 1pt solid rgb(163, 163, 163); border-collapse: collapse; direction: ltr;" border="1" cellspacing="0" cellpadding="0" valign="top"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;tbody&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="155"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;&lt;strong&gt;&lt;u&gt;Milestone&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;strong&gt;&lt;u&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="152"&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;&lt;strong&gt;&lt;u&gt;Who Cares&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;strong&gt;&lt;u&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="249"&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;&lt;strong&gt;&lt;u&gt;What They Care About&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="155"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Design Phase&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="152"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Developers &lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Program Managers &lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Peer Testers &lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Managers&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="249"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Testability of a feature&lt;/font&gt;&lt;/p&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Design of a feature&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Manual and automated test coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Impacts to other features&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;How long testing will take&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Strategy&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="155"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Implementation Phase&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="152"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Developers&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Program Managers&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Managers&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Vendors&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Security Experts&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="249"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Checklist of signoff items&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Security Scenarios&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Strategy&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="155"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Stabilization Phase&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="152"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Managers&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Program Managers&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Peer Testers&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Vendors&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Sustained Engineering&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="249"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Checklist of signoff items&lt;/font&gt;&lt;/p&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Strategy&lt;/font&gt;&lt;/p&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="155"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Post Release&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="152"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Sustained Engineering&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Security Experts&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Peer testers&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="249"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Strategy&lt;/font&gt;&lt;/p&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Security Scenarios                &lt;br /&gt;Checklist of signoff items&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;The two topics that are cared about in every milestone are test coverage and test strategy.&amp;#160; Put simply, it is what is covered and why.&amp;#160; Most of the time, test specs and test plans focus more on items in the design phase because this is when test plans are usually reviewed and iterated on.&amp;#160; The people in the test plan reviews chose to focus on those items.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Problem 2: What Is the Test Plan Used For?&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;It isn’t always clear what a test plan is used for once it has been written.&amp;#160; Often times, there are notes of work items and costs, lists of tests that need to be run or automated and perhaps specific performance and behavior goals to reference but it usually isn’t looked at again until sustained engineering handoff or something’s gone wrong.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Making test plans something that are consistently referenced, reviewed and used should be a goal for any test team.&amp;#160; Otherwise, the exercise of writing the test plan is simply to think about how someone would test the feature and highlight areas of concern in a developer’s design.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Let’s go back to a subset test plan users:&lt;/font&gt;&lt;/p&gt;  &lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;  &lt;div style="list-style-type: disc; direction: ltr;"&gt;&lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;    &lt;table style="border: 1pt solid rgb(163, 163, 163); border-collapse: collapse; direction: ltr;" border="1" cellspacing="0" cellpadding="0" valign="top"&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;tbody&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;        &lt;tr&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="155"&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;&lt;strong&gt;&lt;u&gt;Users&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;strong&gt;&lt;u&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="285"&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;&lt;strong&gt;&lt;u&gt;Needs&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="155"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Feature Tester&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="285"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;Design Phase&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Testability of a feature&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Manual and automated test coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Strategy&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;Implementation Phase&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test work items&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test cases&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Security scenarios&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;Stabilization Phase&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Cases&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Checklist of signoff items&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="155"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Managers                &lt;br /&gt;Feature Team&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="285"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;Design Phase&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;How long testing will take&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test strategy&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;Implementation Phase&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test work items&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Cases&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;Stabilization Phase&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Checklist of signoff items&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="155"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Sustained Engineering                &lt;br /&gt; Security Experts                 &lt;br /&gt; Future Feature Testers&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="285"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;Stabilization Phase&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Strategy&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Cases&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Test Coverage&lt;/font&gt;&lt;/p&gt;           &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in 0in 0in 0.375in;"&gt;&lt;font size="2" face="Calibri"&gt;Checklist of signoff items&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;font style="font-size: 12pt;"&gt;&lt;/font&gt;  &lt;h3&gt;Problem 3: Keeping the Test Plan Up-to-Date&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;If developers are following more traditional design then implement models, the test plan will usually be signed off prior to a developer starting implementation work.&amp;#160; What happens to the test plan now?&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;There are three scenarios to consider: &lt;/font&gt;&lt;/p&gt;  &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;  &lt;div style="list-style-type: disc; direction: ltr;"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;    &lt;table style="border: 1pt solid rgb(163, 163, 163); border-collapse: collapse; direction: ltr;" border="1" cellspacing="0" cellpadding="0" valign="top"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;tbody&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="608"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;Scenario&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="134"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;span&gt;&lt;font size="2" face="Calibri"&gt;Test Plan Needs Changes&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="608"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Developer Design and Spec do not change, feature is implemented exactly as described&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="134"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;No&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="608"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;User requirements change and minor updates or design changes are needed.&lt;span style="mso-spacerun: yes;"&gt;&amp;#160; &lt;/span&gt;Feature goals modestly updated and changed&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="134"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Yes&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;        &lt;tr&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="608"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Major changes to requirements and design cause implementation to drastically change.&lt;span style="mso-spacerun: yes;"&gt;&amp;#160; &lt;/span&gt;Feature is implemented completely differently from original design. &lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;         &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;          &lt;td style="padding: 4pt; border: 1pt solid rgb(163, 163, 163); vertical-align: top;" width="134"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;            &lt;p style="margin: 0in;"&gt;&lt;font size="2" face="Calibri"&gt;Yes&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;       &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;/div&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;But what usually happens in these situations?&amp;#160; If deadlines or milestones are tight, the actual test plan might not be updated.&amp;#160; Or, more often than not, the test cases and scenarios are updated on a case by case basis in automation but not necessarily captured in the original document.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Test Plan of the Future™: Features and Requirements&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;So, after all of that what does the Test Plan of the Future™ need?&amp;#160; Here are some of the requirements that I thought of that will address the needs of the primary users:&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Test Items&lt;/font&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Test Cases&lt;/font&gt;&lt;/li&gt;      &lt;ul&gt;       &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Manual&lt;/font&gt;&lt;/li&gt;        &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Automated&lt;/font&gt;&lt;/li&gt;        &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Security Specific Tests&lt;/font&gt;&lt;/li&gt;     &lt;/ul&gt;      &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Test Coverage&lt;/font&gt;&lt;/li&gt;      &lt;ul&gt;       &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Code Coverage&lt;/font&gt;&lt;/li&gt;        &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Scenario Coverage&lt;/font&gt;&lt;/li&gt;     &lt;/ul&gt;      &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Checklist for Signing off&lt;/font&gt;&lt;/li&gt;      &lt;ul&gt;       &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Items discussed among feature/product owners&lt;/font&gt;&lt;/li&gt;     &lt;/ul&gt;      &lt;li&gt;&lt;font size="2" face="Calibri"&gt;General Test Strategy Notes&lt;/font&gt;&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Feature Spec/Dev Items&lt;/font&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Features&lt;/font&gt;&lt;/li&gt;      &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Prioritized Scenarios&lt;/font&gt;&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Easy to Update&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Reflects the current state of the product&lt;/font&gt;&lt;/li&gt;  &lt;/ul&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;This list of requirements satisfies a majority of the needs laid out above.&amp;#160; If test plans can reflect the current state of the product, highlight feature and scenario coverage all while being easy to update, it can become a really valuable tester resource.&lt;/font&gt;&amp;#160; &lt;/p&gt;  &lt;h3&gt;Test Plans: Looking Ahead…&lt;/h3&gt;  &lt;p&gt;As things progress, I’m going to try investigating and implementing different types of Test Plans of the Future™.&amp;#160; Stay tuned for future posts on this topic…&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10271089" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/test/">test</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/test+plan/">test plan</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/testing/">testing</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/software+testing/">software testing</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/test+spec/">test spec</category></item><item><title>Speech Recognition - Using Multiple Grammars to Improve Recognition</title><link>http://blogs.msdn.com/b/rlucero/archive/2012/02/03/speech-recognition-using-multiple-grammars-to-improve-recognition.aspx</link><pubDate>Fri, 03 Feb 2012 17:22:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10263776</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10263776</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2012/02/03/speech-recognition-using-multiple-grammars-to-improve-recognition.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2" face="Calibri"&gt;A difficult problem both users and developers face is recognizing words that are similar sounding, but wrong for the current context.&amp;#160; An example of this would be the words “yellow” and “hello”.&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Using the simple WPF app from the previous &lt;/font&gt;&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2012/01/17/speech-recognition-exploring-grammar-based-recognition.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;Exploring Grammar Based Recognition&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Calibri"&gt; post, I will show an example of this confusion and a simple way to improve recognition based on a defined context.&amp;#160; Specifically, a button to enable and disable grammars will be added to simulate context switching.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Check 2, 3… Check…&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;This is a continuation of the previous &lt;/font&gt;&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2012/01/17/speech-recognition-exploring-grammar-based-recognition.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;Exploring Grammar Based Recognition&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Calibri"&gt; post.&amp;#160; Please make sure that you’ve installed the Windows SDK as a prerequisite to both of these tutorials.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Step 1: Identifying Recognition Confusion&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Using the Simple Speech Recognizer, add the word “hello” to the list of words to be recognized.&amp;#160; Then repeat saying “hello” and “yellow” with various inflections.&amp;#160; Depending on how I said it, I was able to get the wrong word recognized.&lt;/font&gt;&lt;/p&gt;  &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/0525.image_5F00_212675F0.png"&gt;&lt;font size="2" face="Calibri"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/2275.image_5F00_thumb_5F00_40D54FB8.png" width="450" height="270" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Calibri"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;  &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;By throwing all the words into the same grammar rule mix, the recognition engine will do its best at guessing what word is spoken.&amp;#160; Unfortunately, a bad user experience may result of a misrecognized word.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Step 2: Improving Recognition Through Multiple Grammars&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;This example of “hello” and “yellow” confusion highlights an interesting problem, but there are some ways to improve this experience.&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;I’m going to first separate out the two recognition word lists into different grammars.&amp;#160; First, move rename the testGrammar to colorGrammar and make it available for other methods to use.&amp;#160; I moved it to the MainWindowClass.&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Second, create another Choices for the greetings grammar.&amp;#160; Populate that with “hello” and any other test words to try out.&amp;#160; To highlight where the recognized word is coming from, I also named the grammars and updated what is written out when the recognition event triggers.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Here’s what things should look like:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font face="Calibri"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="#2b91af"&gt;SpeechRecognizer&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sr&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;font color="black"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;colorList&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;font color="black"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;greetingsList&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="#2b91af"&gt;Choices&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;colors&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="#2b91af"&gt;Choices&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;greetings&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="#2b91af"&gt;Grammar&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;colorGrammar&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Calibri"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="#2b91af"&gt;Grammar&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;greetingsGrammar&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;/blockquote&gt;  &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Updates to LoadGrammar():&lt;/font&gt;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font size="2" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="blue"&gt;private&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;LoadGrammar()&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="darkgreen"&gt;//Load up the Choices object with the contents of the Color list, populate the GrammarBuilder,         &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="darkgreen"&gt;//create a Grammar with the Grammar builder helper and load it up into the SpeechRecognizer         &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;colors.Add(colorList.ToArray())&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;greetings.Add(greetingsList.ToArray())&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;GrammarBuilder&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;colorGrammarBuilder&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;GrammarBuilder(colors)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;GrammarBuilder&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;greetingsGrammarBuilder&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;GrammarBuilder(greetings)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;colorGrammar&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;Grammar(colorGrammarBuilder)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;colorGrammar.Name&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;colorGrammar&amp;quot;&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;greetingsGrammar&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;Grammar(greetingsGrammarBuilder)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;greetingsGrammar.Name&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;greetingsGrammar&amp;quot;&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;sr.LoadGrammar(greetingsGrammar)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;sr.LoadGrammar(colorGrammar)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;/div&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;And the Speech Recognized Event:&lt;/font&gt;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sr_SpeechRecognized(&lt;/font&gt;&lt;font color="blue"&gt;object&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sender,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;SpeechRecognizedEventArgs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;textBox1.Text&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;textBox1.Text&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e.Result.Text&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot; - \t&amp;quot; &lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e.Result.Grammar.Name+&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;\r\n&amp;quot;&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;/div&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;If you run the app now, both “hello” and “yellow” will be recognized and confused.&amp;#160; So, I will add one button to toggle the greetingsGrammar.Enabled flag.&amp;#160; Here’s what my button click method looks like:&lt;/font&gt;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font face="Calibri"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="blue"&gt;private&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;button2_Click(&lt;/font&gt;&lt;font color="blue"&gt;object&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sender,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;RoutedEventArgs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;sr.Grammars[sr.Grammars.IndexOf(greetingsGrammar)].Enabled&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;!sr.Grammars[sr.Grammars.IndexOf(greetingsGrammar)].Enabled&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="blue"&gt;if&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;(sr.Grammars[sr.Grammars.IndexOf(greetingsGrammar)].Enabled&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;==&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;true&lt;/font&gt;&lt;font color="black"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;button2.Content&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;Disable Greetings&amp;quot;&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="blue" size="2" face="Consolas"&gt;else&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;button2.Content&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;Enable Greetings&amp;quot;&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div class="code"&gt;&lt;font size="2" face="Calibri"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div class="code"&gt;&lt;font size="2" face="Calibri"&gt;Now, when you click the button words in the greetings grammar won’t be listened for.&lt;/font&gt;&amp;#160; &lt;/div&gt;  &lt;div class="code"&gt;&amp;#160;&lt;/div&gt;  &lt;div class="code"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/1602.image_5F00_0E717C39.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/7571.image_5F00_thumb_5F00_204E1006.png" width="446" height="306" /&gt;&lt;/a&gt;&lt;/div&gt;  &lt;h3&gt;What Was Improved?&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;In this case, pressing the button changes the words that the Speech Recognition engine is listening for.&amp;#160; If the grouping inside of grammar rules or grammars are clever, developers can enable and disable scenarios when the system moves into a specific state.&amp;#160; It can give context and, in some cases, better accuracy for the words the system is listening for.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;However, it doesn’t improve the more basic problem of confusion if someone says a word that sounds very similar to a word the engine is listening for.&amp;#160; This process primarily helps by focusing or broadening the words available for recognition.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Summary&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;By dynamically enabling and disabling grammars, apps have another tool to help improve the recognition scenarios.&amp;#160; Contexts that are provided and acted upon can make for a better recognition experience.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Here are some posts I found useful:&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.speech.recognition.grammar.enabled(v=VS.85).aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;MSDN Definition for Grammar.Enabled&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms556977(v=vs.85).aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;MSDN Grammar Loading Example&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;  &lt;/ul&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;For more ideas or for more background on this post check out my previous post: &lt;/font&gt;&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2012/01/17/speech-recognition-exploring-grammar-based-recognition.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;Exploring Grammar Based Recognition&lt;/font&gt;&lt;/a&gt;.&amp;#160; As always, if you have feedback or questions feel free to leave a comment or contact me through the MSDN blog dashboard tools!&lt;/p&gt;  &lt;p&gt;Once again, thanks go out to Steve Meyer for providing awesome feedback regarding this post!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10263776" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/speech/">speech</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/system-speech/">system.speech</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/managed/">managed</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/win7/">win7</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/windows+7/">windows 7</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/c_2300_/">c#</category></item><item><title>Speech 101, Part 3 - Text To Speech: Getting the Computer to Carry the Conversation</title><link>http://blogs.msdn.com/b/rlucero/archive/2012/01/27/speech-101-part-3-text-to-speech-getting-the-computer-to-carry-the-conversation.aspx</link><pubDate>Fri, 27 Jan 2012 19:51:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10261299</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10261299</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2012/01/27/speech-101-part-3-text-to-speech-getting-the-computer-to-carry-the-conversation.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2" face="Calibri"&gt;In my previous posts I covered a number of scenarios around &lt;/font&gt;&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2012/01/17/speech-recognition-exploring-grammar-based-recognition.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;user speech recognition&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Calibri"&gt;.&amp;#160; System.Speech also includes the capability to synthesize text into sounds which can be used to create unique conversational experiences.&amp;#160; &lt;/font&gt;&lt;/p&gt; &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;There are a number of great examples on writing Text-to-Speech apps and plugins.&amp;#160; I will highlight getting up and running quickly with some examples.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Check 1,2…&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;The &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/bb980924.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;Windows SDK&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Calibri"&gt; is a requirement for the following example.&amp;#160; It needs to be installed to follow along.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;TTS Part 1 - Giving the Computer Something to Say&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;There are two ways to get up and running with System.Speech’s Speech Synthesizer.&amp;#160; Simplest way is by creating an instance of the SpeechSynthesizer object and passing a string to the Speak method.&lt;/font&gt;&amp;#160; &lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;SpeechSynthesizer&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;synth&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;SpeechSynthesizer()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&lt;/font&gt;&lt;font color="black"&gt;synth.Speak(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;Text to Speak&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;That’s it.&amp;#160; This is the fastest way to get computers talking to users.&amp;#160; Developers can incorporate this into audio prompts or notifications, general audio feedback from the system or whatever they can think of.&lt;/font&gt;&amp;#160; &lt;/p&gt;  &lt;h3&gt;TTS Part 2 - Sometimes Hints Help&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;The simple method that is described above will cause the Speech engine to give its best guess at what the string is when it goes to synthesize.&amp;#160; This works well with simple phrases, but not always.&amp;#160; Try passing test strings and see what is working by default and what might need to be spelled out.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;While working on this blog post I noticed that dates, times, and basic addresses seem to work out of the box.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;TTS Part 3 - This Time With Some &lt;em&gt;Feeling&lt;/em&gt;&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;One of the really fun things to do with the SpeechSynthesizer is to adjust the voice, rate and emphasis of what the computer is saying.&amp;#160; Properly configured, it can give applications a little more personality.&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Calibri"&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;u&gt;Important Note:&lt;/u&gt;&amp;#160; &lt;/strong&gt;This only works if there are additional voices installed on users systems and if the voices are compatible with the changes that are described.&amp;#160; If for some reason, the selected voice cannot be configured with the specific settings the Synthesizer will default to base operating system settings.&amp;#160; This includes changing the voice.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;PromptBuilder is a great way to modify how the computer sounds in code.&amp;#160; In this example I will show how use both PromptBuilder and PromptStyle to slow down the computer voice using a global shared PromptBuilder.&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;promptBuilder.ClearContent()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;PromptStyle&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;style&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;PromptStyle()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;style.Rate&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;PromptRate.ExtraSlow&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;         &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;promptBuilder.StartStyle(style)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;promptBuilder.AppendText(phraseTextBox.Text)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;promptBuilder.EndStyle()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;         &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;speechSynth.SpeakAsync(promptBuilder)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;There are a number of other configurable options within both PromptBuilder and PromptStyle to give the computer a personality, but as the note describes it is contingent on the voices that are available to the operating system.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;TTS Part 3 - Interrupting What the Computer Has to Say&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Depending on how much the computer has to say users might reach a point where they think to themselves “Too much talking! How do I make this stop!?”.&amp;#160; This example will cover wiring up a basic cancel button action.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;First, create a global Prompt object and register two of the main Speech Synthesizer events, SpeakStarted and SpeakCompleted:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;speechSynth.SpeakStarted&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;EventHandler&lt;/font&gt;&lt;font color="black"&gt;&amp;lt;SpeakStartedEventArgs&amp;gt;(speechSynth_SpeakStarted)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;speechSynth.SpeakCompleted&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;EventHandler&lt;/font&gt;&lt;font color="black"&gt;&amp;lt;SpeakCompletedEventArgs&amp;gt;(speechSynth_SpeakCompleted)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;         &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;speechSynth_SpeakCompleted(&lt;/font&gt;&lt;font color="blue"&gt;object&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sender,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;SpeakCompletedEventArgs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;cancelButton.IsEnabled&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;false;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;         &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;speechSynth_SpeakStarted(&lt;/font&gt;&lt;font color="blue"&gt;object&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sender,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;SpeakStartedEventArgs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;cancelButton.IsEnabled&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;true;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Next, define the cancel button behavior to stop the global prompt midsentence:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="blue"&gt;private&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;cancelButton_Click(&lt;/font&gt;&lt;font color="blue"&gt;object&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sender,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;RoutedEventArgs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;speechSynth.SpeakAsyncCancel(cancelPrompt)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Finally, set the global cancel prompt when calling SpeakAsync from the Synthesizer:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="blue"&gt;private&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;speakButton_Click(&lt;/font&gt;&lt;font color="blue"&gt;object&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sender,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;RoutedEventArgs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;cancelPrompt&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;speechSynth.SpeakAsync(phraseTextBox.Text)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt; &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Now users can interrupt the computer if it becomes too verbose.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Summary&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Text-to-Speech can really enable some cool user scenarios and give applications another way to convey information.&amp;#160; There are all sorts of additional TTS features and possibilities to explore.&amp;#160; Below you will fine some additional resources and posts that I found useful:&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/hh361602.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;Using .NET to Speak the Contents of a String&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/hh361616.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;Constructing Complex Speech Prompts&lt;/font&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Also, check out my previous posts on Speech Recognition:&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/12/12/speech-101-getting-the-computer-to-recognize-hello-world.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;Speech 101 - Using C++ For Speech Recognition&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2012/01/10/speech-101-part-2-using-c-to-recognize-hello-world.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;Speech 101, Part 2 - Using C# for Speech Recognition&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2012/01/17/speech-recognition-exploring-grammar-based-recognition.aspx" target="_blank"&gt;&lt;font size="2" face="Calibri"&gt;Exploring Dynamic Grammars in Speech Recognition&lt;/font&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10261299" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/speech/">speech</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/system-speech/">system.speech</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/win7/">win7</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/text_2D00_to_2D00_speech/">text-to-speech</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/tts/">tts</category></item><item><title>Speech Recognition - Exploring Grammar Based Recognition</title><link>http://blogs.msdn.com/b/rlucero/archive/2012/01/17/speech-recognition-exploring-grammar-based-recognition.aspx</link><pubDate>Tue, 17 Jan 2012 17:11:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10257660</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10257660</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2012/01/17/speech-recognition-exploring-grammar-based-recognition.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2" face="Calibri"&gt;In my two &lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/12/12/speech-101-getting-the-computer-to-recognize-hello-world.aspx" target="_blank"&gt;previous&lt;/a&gt; &lt;a href="http://blogs.msdn.com/b/rlucero/archive/2012/01/10/speech-101-part-2-using-c-to-recognize-hello-world.aspx" target="_blank"&gt;posts&lt;/a&gt;, I covered how to create speech recognition engines and use them to parse through WAV files containing a sample “Hello World” recording.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;This post will focus on two things.&amp;#160; First, simple real-time recognition with a simple hardcoded grammar and second, a way to let you dynamically improve the system by updating the grammar.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Configuring Windows to Enable Speech Recognition&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;The core Windows operating system has had built in speech recognition since Vista.&amp;#160; You must enable the OS speech recognition in order for this tutorial to work.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;&lt;strong&gt;&lt;u&gt;On Windows 7:&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Follow the instructions here: &lt;/font&gt;&lt;a title="http://windows.microsoft.com/en-US/windows7/Set-up-your-microphone-for-Speech-Recognition" href="http://windows.microsoft.com/en-US/windows7/Set-up-your-microphone-for-Speech-Recognition"&gt;&lt;font size="2" face="Calibri"&gt;http://windows.microsoft.com/en-US/windows7/Set-up-your-microphone-for-Speech-Recognition&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;   &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Important: Don’t forget what was chosen to enable speech recognition!        &lt;br /&gt;&lt;/font&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/2625.image_5F00_725ABE5B.png"&gt;&lt;font size="2" face="Calibri"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/8585.image_5F00_thumb_5F00_641C456B.png" width="482" height="165" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;   &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Once the wizard is complete, you can enable and disable speech using the method specified or with the UI that shows up:        &lt;br /&gt;&lt;/font&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/1541.image_5F00_51D37EA9.png"&gt;&lt;font size="2" face="Calibri"&gt;&lt;img style="margin: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/7802.image_5F00_thumb_5F00_119D652F.png" width="244" height="57" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;   &lt;font size="2" face="Calibri"&gt;&lt;/font&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Try it out by following the User Experience tutorial.&lt;/font&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;h3&gt;Listen Up: Writing a Basic Real-Time Speech Recognition WPF App&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;This is a simple modification on the great &lt;a href="http://msdn.microsoft.com/en-us/library/hh361683.aspx" target="_blank"&gt;MSDN tutorial&lt;/a&gt; for the System.Speech namespace.&amp;#160; It is an application that will listen for colors that are predefined in a Speech Choices object and will write the output to a text box if the color was correctly recognized.&amp;#160; Inside of this app I will show how to:&lt;/font&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Initialize a simple grammar based on a string array&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Initialize a Speech Recognizer object, which enables basic real-time speech recognition&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Wiring up a way to update the current grammar&lt;/font&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;And as always, the &lt;a href="http://msdn.microsoft.com/en-us/bb980924.aspx" target="_blank"&gt;Windows SDK&lt;/a&gt; is a requirement.&amp;#160; Please install it to follow along with this tutorial.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Step 1:&amp;#160; Initialize the Simple Grammar and Speech Recognizer&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;First, launch Visual Studio and start with a blank WPF app.&amp;#160; In the designer, add two text boxes, three labels and one button like so:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/1538.image_5F00_2379F8FC.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/3276.image_5F00_thumb_5F00_4A480F3C.png" width="388" height="258" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Set the larger text box to read only to get the best results from this tutorial.&amp;#160; Once the UI objects have been created and laid out open up the window’s code behind file.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Next, add System.Speech to the project references:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/5355.image_5F00_7116257C.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/0167.image_5F00_thumb_5F00_02F2B94A.png" width="426" height="159" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Now, add following code to the Window constructor:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#2b91af"&gt;SpeechRecognizer&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sr&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&lt;/font&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;font color="black"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;colorList&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&lt;/font&gt;&lt;font color="#2b91af"&gt;Choices&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;colors&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&lt;/font&gt;&lt;font color="blue"&gt;public&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;MainWindow()&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&lt;/font&gt;&lt;font color="black"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;InitializeComponent()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;sr&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;SpeechRecognizer()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;colors&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;Choices()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;colorList&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;font color="black"&gt;&amp;lt;&lt;/font&gt;&lt;font color="blue"&gt;string&lt;/font&gt;&lt;font color="black"&gt;&amp;gt;()&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;red&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;yellow&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;green&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;blue&amp;quot; &lt;/font&gt;&lt;font color="black"&gt;}&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;InitializeSpeechRecogonition()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&lt;/font&gt;&lt;font color="black"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Once that’s done, it is time to create the InitializeSpeechRecognizer and the LoadGrammar helper methods:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="blue"&gt;private&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;InitializeSpeechRecogonition()&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080" size="2" face="Consolas"&gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="darkgreen"&gt;//First, load the grammar then wire up the Speech Recognition events&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;font color="#808080"&gt;&lt;font color="#006400"&gt;&amp;#160;&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black"&gt;LoadGrammar()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;sr.SpeechRecognized&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;EventHandler&lt;/font&gt;&lt;font color="#2b91af"&gt;&amp;lt;SpeechRecognizedEventArgs&amp;gt;&lt;/font&gt;&lt;font color="black"&gt;(sr_SpeechRecognized)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;           &lt;br /&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/blockquote&gt; &lt;font size="2" face="Consolas"&gt;&lt;/font&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="blue"&gt;private&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;LoadGrammar()&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="darkgreen"&gt;//Load up the Choices object with the contents of the Color list, populate the GrammarBuilder,            &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="darkgreen"&gt;//create a Grammar with the Grammar builder helper and load it up into the SpeechRecognizer           &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;colors.Add(colorList.ToArray())&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;GrammarBuilder&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;grammarBuilder&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;GrammarBuilder(colors)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;Grammar&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;testGrammar&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;Grammar(grammarBuilder)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="black"&gt;sr.LoadGrammar(testGrammar)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;There are three objects of interest.&amp;#160; The SpeechRecognizer object, Choices, and the Grammar.&amp;#160; SpeechRecognizer hooks into the operating system’s shared recognizer but initializes its own engine to handle recognition events.&amp;#160; The benefit of using SpeechRecognizer is that it makes it doesn’t require the developer to worry about the audio input, but it doesn’t allow for more advanced recognition scenarios.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Choices is a basic way to create simple grammars without having to define a detailed external grammar file.&amp;#160; For this tutorial and basic scenarios requiring only simple recognition this is a great way to get started.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;The Grammar object is instantiated from the GrammarBuilder, which will create a root rule for the string list that is contained within the Choices object.&amp;#160; This is &lt;strong&gt;*essential*&lt;/strong&gt; for the Speech Recognition engine.&amp;#160; Without a grammar, there is nothing that the recognition engine can use to determine what was said.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Now that all the Speech Recognition objects have been wired up, set the Speech Recognized handler to write the output to the output text box:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sr_SpeechRecognized(&lt;/font&gt;&lt;font color="blue"&gt;object&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sender,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;SpeechRecognizedEventArgs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e)&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;/font&gt;&lt;font color="black"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;textBox1.Text&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;textBox1.Text&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e.Result.Text&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;\r\n&amp;quot;&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;/font&gt;&lt;font color="black"&gt;}&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Once all of this is completed, the app will listen for whatever colors you defined in the colorList.&amp;#160; In this example those colors are red, yellow, green and blue.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Step 2:&amp;#160; Getting the App to Listen and Listen Better&lt;/h3&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Launch the application and enable Windows Speech Recognition.&amp;#160; Make sure that if you have to click outside of your application to enable recognition, you click back into the test app.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Now try it out!&amp;#160; Speak into your microphone and say one of the words that exist in the list.&amp;#160; A few things will happen:&lt;/font&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;font size="2" face="Calibri"&gt;The word that was said wasn’t recognized.&amp;#160; Either it was the correct word and the engine couldn’t figure it out or a word that wasn’t in the list was said.&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;The word was recognized and showed up in the text box.&amp;#160; Awesome!&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;A different word was said, but a word in the list was recognized instead.&lt;/font&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;This is an example of ‘bad’ recognition happening to me:      &lt;br /&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/3704.image_5F00_42BC9FCF.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/2046.image_5F00_thumb_5F00_698AB60F.png" width="287" height="186" /&gt;&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;In this case of bad recognition, apparently the word I said and they way I said it was enough to&amp;#160; recognize a word that was in the grammar.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Using the text box and button that were also added to the app, I am going to enable the user to improve the recognition experience by adding words to the list and reloading the grammar.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;All you need to do is wire up the button’s click event and add the following code:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="blue"&gt;private&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;button1_Click(&lt;/font&gt;&lt;font color="blue"&gt;object&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sender,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;RoutedEventArgs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="blue"&gt;if&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;(!&lt;/font&gt;&lt;font color="#2b91af"&gt;String&lt;/font&gt;&lt;font color="black"&gt;.IsNullOrEmpty(textBox2.Text))&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;colorList.Add(textBox2.Text)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;LoadGrammar()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;textBlock1.Text&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;Added: &amp;quot; &lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;textBox2.Text&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;textBox2.Text&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;string&lt;/font&gt;&lt;font color="black"&gt;.Empty&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Now, when users add a word and click the Add button, the Speech Recognizer’s grammar will be reloaded with the new word.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/2112.image_5F00_1058CC50.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/3201.image_5F00_thumb_5F00_5022B2D5.png" width="448" height="178" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;The grammar is updated and new words are recognized based on user input.&lt;/font&gt;&lt;/p&gt;  &lt;h2&gt;Summary&lt;/h2&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Try out other grammar scenarios.&amp;#160; My previous two posts use a grammar file that can be modified and loaded up externally.&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;There are some useful tutorials and code examples over on MSDN.&amp;#160; You can check them out here:&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Getting Started With Speech Recognition: &lt;a title="http://msdn.microsoft.com/en-us/library/hh361683.aspx" href="http://msdn.microsoft.com/en-us/library/hh361683.aspx"&gt;http://msdn.microsoft.com/en-us/library/hh361683.aspx&lt;/a&gt;&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Exploring Speech Recognition from MSDN magazine (note - this was written in the Vista timeframe, so there are updates that apply only to Win7): &lt;a title="http://msdn.microsoft.com/en-us/magazine/cc163663.aspx" href="http://msdn.microsoft.com/en-us/magazine/cc163663.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/cc163663.aspx&lt;/a&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Check out my other blog posts on the Speech Recognition Engine:&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Speech 101 - Using C++: &lt;a title="http://blogs.msdn.com/b/rlucero/archive/2011/12/12/speech-101-getting-the-computer-to-recognize-hello-world.aspx" href="http://blogs.msdn.com/b/rlucero/archive/2011/12/12/speech-101-getting-the-computer-to-recognize-hello-world.aspx"&gt;http://blogs.msdn.com/b/rlucero/archive/2011/12/12/speech-101-getting-the-computer-to-recognize-hello-world.aspx&lt;/a&gt;&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2" face="Calibri"&gt;Speech 101 - Using C#: &lt;a title="http://blogs.msdn.com/b/rlucero/archive/2012/01/10/speech-101-part-2-using-c-to-recognize-hello-world.aspx" href="http://blogs.msdn.com/b/rlucero/archive/2012/01/10/speech-101-part-2-using-c-to-recognize-hello-world.aspx"&gt;http://blogs.msdn.com/b/rlucero/archive/2012/01/10/speech-101-part-2-using-c-to-recognize-hello-world.aspx&lt;/a&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font size="2" face="Calibri"&gt;Special thanks to Steve Meyer for reviewing this post and suggesting the blog title!&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10257660" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/speech/">speech</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/system-speech/">system.speech</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/managed/">managed</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/win7/">win7</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/windows+7/">windows 7</category></item><item><title>Speech 101, Part 2 - Using C# to Recognize “Hello World”</title><link>http://blogs.msdn.com/b/rlucero/archive/2012/01/10/speech-101-part-2-using-c-to-recognize-hello-world.aspx</link><pubDate>Tue, 10 Jan 2012 17:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10255167</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>17</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10255167</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2012/01/10/speech-101-part-2-using-c-to-recognize-hello-world.aspx#comments</comments><description>&lt;p&gt;&lt;font size="3" face="Calibri"&gt;In my &lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/12/12/speech-101-getting-the-computer-to-recognize-hello-world.aspx" target="_blank"&gt;last post&lt;/a&gt; I covered how to perform basic speech recognition with a simple grammar and a “Hello World” WAV recording in C++.&amp;#160; This post will cover how to accomplish what was in the previous post, but this time using the managed APIs.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Sound Check, Round 2&lt;/h3&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;The support files for this example can be found &lt;a href="https://skydrive.live.com/?cid=96de2b286fec8cbd&amp;amp;id=96DE2B286FEC8CBD%21150"&gt;here&lt;/a&gt;.&amp;#160; Both HelloWorld.xml and HelloWorld.wav are required.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;Again, in addition to the helper files the &lt;a href="http://msdn.microsoft.com/en-us/bb980924.aspx"&gt;Windows SDK&lt;/a&gt; is also required.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Hello, Hello? Is this C#?&lt;/h3&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;The most basic Speech recognition work flow is this:&lt;/font&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;font size="3" face="Calibri"&gt;Create a Speech Recognition Engine&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="3" face="Calibri"&gt;Load a Grammar&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="3" face="Calibri"&gt;Set the Engine’s input&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="3" face="Calibri"&gt;Handle Recognition Events&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="3" face="Calibri"&gt;Start Recognition&lt;/font&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;F&lt;/font&gt;&lt;font size="3" face="Calibri"&gt;irst, launch Visual Studio and create a new Visual C# Console Application.&amp;#160; Copy the two helper files to the project root directory, add them to the project and set their properties to “Copy on Build”.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;Next, it is time to create a SpeechRecognitionEngine and Grammar:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="#2b91af"&gt;SpeechRecognitionEngine&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;srEngine&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;SpeechRecognitionEngine()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div class="code"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="#2b91af"&gt;Grammar&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;gram&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;Grammar(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;helloworld.xml&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;Now, load the grammar into the engine and set the engine’s input to the sample wave file:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;srEngine.LoadGrammar(gram)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;srEngine.SetInputToWaveFile(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;helloworld.wav&amp;quot;&lt;/font&gt;&lt;font color="black"&gt;)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;Last thing to do is handle the recognition events and start recognition:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;srEngine.SpeechRecognized&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="blue"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;new&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;EventHandler&lt;/font&gt;&lt;font color="#000000"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#2b91af"&gt;SpeechRecognizedEventArgs&lt;font color="#000000"&gt;&amp;gt;(&lt;/font&gt;srEngine_SpeechRecognized&lt;/font&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="black"&gt;srEngine.Recognize()&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;Here’s an easy example for the Recognition Handler:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;div class="code"&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="blue"&gt;static&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="blue"&gt;void&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;srEngine_SpeechRecognized(&lt;/font&gt;&lt;font color="blue"&gt;object&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;sender,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#4bacc6"&gt;SpeechRecognizedEventArgs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;font color="#2b91af"&gt;Console&lt;/font&gt;&lt;font color="black"&gt;.WriteLine(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;Detected: &amp;quot; &lt;/font&gt;&lt;font color="black"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="black"&gt;e.Result.Text)&lt;/font&gt;&lt;font color="blue"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;       &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="black" size="2" face="Consolas"&gt;}&lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;That’s it.&amp;#160; When the application runs, “Detected: Hello world” should be written to the console window.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;Now you have a simple recognition example in just 10 lines of code.&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;What Next?&lt;/h3&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;Try out some of the SAPI experiments listed in my first &lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/12/12/speech-101-getting-the-computer-to-recognize-hello-world.aspx" target="_blank"&gt;Speech 101 post&lt;/a&gt;.&amp;#160; Also, look at the different recognition events and results.&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Resources&lt;/h3&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;MSDN’s Documentation on the Speech Recognition Engine:     &lt;br /&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/hh361636.aspx" href="http://msdn.microsoft.com/en-us/library/hh361636.aspx"&gt;http://msdn.microsoft.com/en-us/library/hh361636.aspx&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Calibri"&gt;MSDN’s Starting Point for Speech Recognition:     &lt;br /&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/hh361633.aspx" href="http://msdn.microsoft.com/en-us/library/hh361633.aspx"&gt;http://msdn.microsoft.com/en-us/library/hh361633.aspx&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10255167" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/speech/">speech</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/system-speech/">system.speech</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/managed/">managed</category></item><item><title>Speech 101 - Getting the Computer to Recognize “Hello World”</title><link>http://blogs.msdn.com/b/rlucero/archive/2011/12/12/speech-101-getting-the-computer-to-recognize-hello-world.aspx</link><pubDate>Mon, 12 Dec 2011 16:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10246785</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10246785</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2011/12/12/speech-101-getting-the-computer-to-recognize-hello-world.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-family: Calibri; font-size: x-small;" face="Calibri" size="2"&gt;I recently started working on the Speech at Microsoft core runtime team.&amp;nbsp; As part of the ramp up process, I needed to write up a simple C++ app using the Speech APIs (SAPI).&amp;nbsp; Below you&amp;rsquo;ll find a simple walk through in what it takes to write up a native app to analyze input wave files.&amp;nbsp; This sample can be the basis for a simple speech recognition feature in your projects.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Sound Check&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;What you&amp;rsquo;ll need for this example is a single wave recording of your voice saying &amp;ldquo;Hello World&amp;rdquo;.&amp;nbsp; I&amp;rsquo;ve made all of the samples available &lt;/span&gt;&lt;a href="https://skydrive.live.com/redir.aspx?cid=96de2b286fec8cbd&amp;amp;resid=96DE2B286FEC8CBD!150&amp;amp;parid=root"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;.&amp;nbsp; The two main things you&amp;rsquo;ll need are &amp;ldquo;helloworld.wav&amp;rdquo; and the corresponding grammar file, &amp;ldquo;helloworld.xml&amp;rdquo;.&amp;nbsp; The source is also included as a reference.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;In addition, you&amp;rsquo;ll need the Speech Development APIs which can be found in the &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/bb980924.aspx"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Windows SDK&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;.&amp;nbsp; The SDK includes both the managed and native APIs.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Crash Course in Speech Recognition&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Before I jump into the example let&amp;rsquo;s look at what happens Speech Recognition from a very basic level:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/5672.image_5F00_1CD39869.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-32-metablogapi/8080.image_5F00_thumb_5F00_408CC003.png" width="455" height="91" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;The SAPI recognition engine takes a loaded WAV file and with the help of a custom grammar file, can determine if the input WAV file is actually recognizable speech.&amp;nbsp; If the engine detects there is a phrase within the WAV, an event is fired and the resulting string is contained within.&amp;nbsp; Developers need to give some guidance to the SAPI recognition engine through the use of a custom grammar file.&amp;nbsp; To learn more about that in complete detail, W3C&amp;rsquo;s &lt;/span&gt;&lt;a href="http://www.w3.org/TR/speech-grammar/"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Grammar RFC&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt; contains all of the information. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Hello Computer, Hello World&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Once the Windows SDK has been installed, launch Visual Studio and create a C++ Win32 console application project.&amp;nbsp; Copy the two helper files to the project root directory, add them to the project and set the property to &amp;ldquo;Copy on build&amp;rdquo;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;First code part - enable COM in the project&amp;rsquo;s stdfax.h:&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class="code"&gt;&lt;span style="color: blue;" color="blue"&gt;#define&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;_ATL_APARTMENT_THREADED&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;#include&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;&amp;lt;atlbase.h&amp;gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;extern&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;CComModule&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;_Module&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;#include&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;&amp;lt;atlcom.h&amp;gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Next, in the main cpp file add the references to SAPI.h and some basic speech objects:&lt;/span&gt;&lt;/p&gt;
&lt;div class="code"&gt;&lt;span style="color: blue;" color="blue"&gt;#include&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;&amp;lt;sapi.h&amp;gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;#include&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;&amp;lt;sphelper.h&amp;gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;int&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;_tmain(&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;int&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;argc,&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;_TCHAR*&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;argv[])&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;{&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;LPCWSTR&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;MY_WAVE_AUDIO_FILENAME&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;LPCWSTR(L&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;"helloworld.wav\0"&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;LPCWSTR&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;TEST_CFG&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;LPCWSTR(L&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;"helloworld.xml\0"&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;CComPtr&amp;lt;ISpStream&amp;gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpInputStream&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;CComPtr&amp;lt;ISpRecognizer&amp;gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecognizer&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;CComPtr&amp;lt;ISpRecoContext&amp;gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecoContext&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;CComPtr&amp;lt;ISpRecoGrammar&amp;gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecoGrammar&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;CComPtr&amp;lt;ISpRecoResult&amp;gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpResult&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;If you haven&amp;rsquo;t already, call CoInitialize(NULL):&lt;/span&gt;&lt;/p&gt;
&lt;div class="code"&gt;&lt;span style="color: blue;" color="blue"&gt;if&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;(FAILED(::CoInitialize(&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;NULL&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;)))&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;{&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;printf(&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;"CoInitialize failed... somehow..."&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;return&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;FALSE;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Now, it is time to initialize the input stream and bind it to a file:&lt;/span&gt;&lt;/p&gt;
&lt;div class="code"&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;CSpStreamFormat&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;sInputFormat&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;sInputFormat.AssignFormat(SPSF_22kHz16BitStereo)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;if&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;(FAILED(hr))&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;{&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;printf(&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;"input formatting failed"&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;return&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;FALSE;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;}&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//bind input stream to a file &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpInputStream-&amp;gt;BindToFile(MY_WAVE_AUDIO_FILENAME,&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;SPFM_OPEN_READONLY,&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;&amp;amp;sInputFormat.FormatId(),&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;sInputFormat.WaveFormatExPtr(),&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;SPFEI_ALL_EVENTS)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//hr check &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;if&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;(FAILED(hr))&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;{&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;printf(&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;"binding to file failed. check file value, etc... "&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;return&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;FALSE;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Once the input stream is set, initialize the Recognizer and configure its input:&lt;/span&gt;&lt;/p&gt;
&lt;div class="code"&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//Initialize the recognition Engine &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecognizer.CoCreateInstance(CLSID_SpInprocRecognizer)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//hook up wav input to the recognizer &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecognizer-&amp;gt;SetInput(cpInputStream,&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;TRUE&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//hr check &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;if&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;(FAILED(hr))&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;{&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;printf(&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;"Linking WAV to recognizer failed. "&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;return&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;FALSE;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Finish up configuring the SR objects by creating the grammar, setting interest level and wiring up the SR Win32 event:&lt;/span&gt;&lt;/p&gt;
&lt;div class="code"&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//Create recognition context &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecognizer-&amp;gt;CreateRecoContext(&amp;amp;cpRecoContext)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecoContext-&amp;gt;CreateGrammar(&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;NULL&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;,&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;&amp;amp;cpRecoGrammar)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecoGrammar-&amp;gt;LoadDictation(&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;NULL&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;,&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;SPLO_STATIC)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//Check for things that are recognized and the end of the stream &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecoContext-&amp;gt;SetInterest(SPFEI_ALL_SR_EVENTS&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;|&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;SPFEI(SPEI_END_SR_STREAM),&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;SPFEI_ALL_SR_EVENTS&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;|&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;SPFEI(SPEI_END_SR_STREAM))&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//hook up the Win32 event &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecoContext-&amp;gt;SetNotifyWin32Event()&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//hr check &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;if&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;(FAILED(hr))&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;{&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;printf(&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;"Wiring up win32 Event failed"&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;return&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;FALSE;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;}&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//Activate Dictation &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecoGrammar-&amp;gt;SetDictationState(SPRS_ACTIVE)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;bool&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;fEndStreamReached&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;FALSE;&lt;/span&gt;&lt;/div&gt;
&lt;div class="code"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="code"&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Specifically, the interest level in this example is to &amp;ldquo;All SR Events&amp;rdquo;. This means that a SR event will fire for everything that the recognizer thinks it can parse accurately.&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;Here&amp;rsquo;s the basic loop for handling the SR Event logic:&lt;/span&gt;&lt;/p&gt;
&lt;div class="code"&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//Do stuff, like analyze the wave or something... &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;while&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;(!fEndStreamReached&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;S_OK&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;==&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecoContext-&amp;gt;WaitForNotifyEvent(&lt;/span&gt;&lt;span style="color: maroon;" color="maroon"&gt;10000&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;))&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;{&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;CSpEvent&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;spEvent&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//extract queued events from reco context's event queue! &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;while&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;(!fEndStreamReached&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;S_OK&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;==&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;spEvent.GetFrom(cpRecoContext))&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;{&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//Figure out the event type &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;switch&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;(spEvent.eEventId)&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;{&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//recognized something &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;case&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;SPEI_RECOGNITION:&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//DO SOMETHING! &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;fFoundSomething&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;TRUE;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;LPWSTR&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;buffer&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpResult&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;spEvent.RecoResult()&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpResult-&amp;gt;GetText(SP_GETWHOLEPHRASE,&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;SP_GETWHOLEPHRASE,&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;TRUE&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;,&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;&amp;amp;buffer,&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;NULL&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;break;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;case&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;SPEI_END_SR_STREAM:&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;fEndStreamReached&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;TRUE;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;break;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;}&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//Clear the event &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;spEvent.Clear()&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;}&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;If everything went well,&amp;nbsp; the buffer in the loop will have &amp;ldquo;Hello World&amp;rdquo; when the recognition event is fired.&amp;nbsp; To double check, set a breakpoint on "fFoundSomething&amp;rdquo; and step through at that point to see if it recognized correctly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;To do things right, here&amp;rsquo;s the clean up code:&lt;/span&gt;&lt;/p&gt;
&lt;div class="code"&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: darkgreen;" color="darkgreen"&gt;//CLEAN UP TIME &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecoGrammar-&amp;gt;SetDictationState(SPRS_INACTIVE)&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpRecoGrammar-&amp;gt;UnloadDictation()&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;" color="black"&gt;hr&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;=&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;" color="black"&gt;cpInputStream-&amp;gt;Close()&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;;&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt; &lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;return&lt;/span&gt;&lt;span style="color: #808080;" color="#808080"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;" color="blue"&gt;TRUE;&lt;/span&gt;&lt;/div&gt;
&lt;h3&gt;SAPI Experiments To Try&lt;/h3&gt;
&lt;p&gt;There are bunch of things to try out with this example to try to get a better understanding on how the SR system works.&amp;nbsp; Here&amp;rsquo;s a quick list of things to try out:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Record your own voice saying &amp;ldquo;Hello World&amp;rdquo; and see if it the app correctly recognizes you.&lt;/li&gt;
&lt;li&gt;Add more grammar and recognition rules to expand what the engine can find&lt;/li&gt;
&lt;li&gt;Comment out the grammar section and see the engine&amp;rsquo;s best guesses at different WAV inputs.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Resources and Thanks!&lt;/h3&gt;
&lt;p&gt;You can find the &lt;a href="http://msdn.microsoft.com/en-us/library/ms717071(v=VS.85).aspx"&gt;MSDN example&lt;/a&gt;, which is what most of this blog post is based on &lt;a href="http://msdn.microsoft.com/en-us/library/ms717071(v=VS.85).aspx"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Special thanks goes out my new test colleagues who have helped me learn and guided me through this example!&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Calibri;" face="Calibri"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10246785" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/sapi/">sapi</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/speech/">speech</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/c_2B002B00_/">c++</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/native/">native</category></item><item><title>WebMatrix 2 Beta - Using IIS Remote Manager to Enhance Your Site</title><link>http://blogs.msdn.com/b/rlucero/archive/2011/11/07/webmatrix-2-beta-using-iis-remote-manager-to-enhance-your-site.aspx</link><pubDate>Tue, 08 Nov 2011 02:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244769</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244769</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2011/11/07/webmatrix-2-beta-using-iis-remote-manager-to-enhance-your-site.aspx#comments</comments><description>If your web hosting provider uses is an IIS shared hosting provider chances are you can use IIS Manager for Remote Administration to additionally configure your site. This post will walk you through a simple WebMatrix publish example, connect to the remote...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/11/07/webmatrix-2-beta-using-iis-remote-manager-to-enhance-your-site.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244769" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/Remote+Manager/">Remote Manager</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/IIS7/">IIS7</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/iisexpress/">iisexpress</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix2/">webmatrix2</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/beta/">beta</category></item><item><title>WebMatrix 2 Beta - Remote Site Editing</title><link>http://blogs.msdn.com/b/rlucero/archive/2011/10/31/webmatrix-2-beta-remote-site-editing.aspx</link><pubDate>Mon, 31 Oct 2011 20:03:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244770</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244770</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2011/10/31/webmatrix-2-beta-remote-site-editing.aspx#comments</comments><description>Remote site editing is integrated in to WebMatrix 2.&amp;#160; This allows for users to quickly edit content from both the original computer where they published from or a completely different computer. Life After Publishing Once you’ve published a site,...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/10/31/webmatrix-2-beta-remote-site-editing.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244770" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix2/">webmatrix2</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/beta/">beta</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/publishing/">publishing</category></item><item><title>WebMatrix 2 Beta - NuGet Gallery</title><link>http://blogs.msdn.com/b/rlucero/archive/2011/10/20/webmatrix-2-beta-nuget-gallery.aspx</link><pubDate>Thu, 20 Oct 2011 16:36:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244771</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244771</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2011/10/20/webmatrix-2-beta-nuget-gallery.aspx#comments</comments><description>NuGet is a versatile library package system that allows users to&amp;#160; extend their web applications with some really cool tools.&amp;#160; WebMatrix V1 users who are familiar with NuGet remember that they had to access the NuGet Package manager through the...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/10/20/webmatrix-2-beta-nuget-gallery.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244771" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix2/">webmatrix2</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/beta/">beta</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix/">webmatrix</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/NuGet/">NuGet</category></item><item><title>WebMatrix 2 Beta - Integrating with IIS Developer Express</title><link>http://blogs.msdn.com/b/rlucero/archive/2011/10/14/webmatrix-2-beta-integrating-with-iis-developer-express.aspx</link><pubDate>Fri, 14 Oct 2011 16:36:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244772</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244772</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2011/10/14/webmatrix-2-beta-integrating-with-iis-developer-express.aspx#comments</comments><description>I want to take the time to describe how WebMatrix works with IIS Express, the development web server.&amp;#160;&amp;#160; I hope that by the end of this article, users will better understand what IIS Express is capable of and how it works with WebMatrix. What...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/10/14/webmatrix-2-beta-integrating-with-iis-developer-express.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244772" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/iisexpress/">iisexpress</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix/">webmatrix</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/iis+express/">iis express</category></item><item><title>WebMatrix 2 Beta - All About Extensions</title><link>http://blogs.msdn.com/b/rlucero/archive/2011/09/26/webmatrix-2-beta-all-about-extensions.aspx</link><pubDate>Mon, 26 Sep 2011 17:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244773</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244773</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2011/09/26/webmatrix-2-beta-all-about-extensions.aspx#comments</comments><description>WebMatrix 2 has been rebuilt with extensibility in mind. We have designed it to allow developers to write MEF based extensions that integrate into the WebMatrix experience. Members of the WebMatrix team have individually published some initial extensions...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/09/26/webmatrix-2-beta-all-about-extensions.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244773" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix2/">webmatrix2</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/beta/">beta</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/Extensibility/">Extensibility</category></item><item><title>WebMatrix 2 Beta–Top 5 Tips and Tricks</title><link>http://blogs.msdn.com/b/rlucero/archive/2011/09/20/webmatrix-2-beta-top-5-tips-and-tricks.aspx</link><pubDate>Tue, 20 Sep 2011 23:40:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244774</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244774</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2011/09/20/webmatrix-2-beta-top-5-tips-and-tricks.aspx#comments</comments><description>You’ve probably seen all of the cool high level features, but there are a number of cool features that are worth checking out.&amp;#160; Like always, let us know what you think on our forums ! 1.&amp;#160; Set Your Default Workspace If you find that you’re always...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/09/20/webmatrix-2-beta-top-5-tips-and-tricks.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244774" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix2/">webmatrix2</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/beta/">beta</category></item><item><title>WebMatrix 2 Beta–Released!</title><link>http://blogs.msdn.com/b/rlucero/archive/2011/09/16/webmatrix-2-beta-released.aspx</link><pubDate>Fri, 16 Sep 2011 19:01:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244775</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244775</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2011/09/16/webmatrix-2-beta-released.aspx#comments</comments><description>Today we’re releasing the first public Microsoft WebMatrix 2 Beta!&amp;#160; It contains a number of new features and improvements from version 1.&amp;#160; Try it out today! Here is just a short list of what’s new and improved: New Features: Remote Site Access...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2011/09/16/webmatrix-2-beta-released.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244775" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix/">webmatrix</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/Extensibility/">Extensibility</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/iis+news+item/">iis news item</category></item><item><title>WebMatrix Beta – Beta 3 Released!</title><link>http://blogs.msdn.com/b/rlucero/archive/2010/11/09/webmatrix-beta-beta-3-released.aspx</link><pubDate>Tue, 09 Nov 2010 17:15:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244776</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244776</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2010/11/09/webmatrix-beta-beta-3-released.aspx#comments</comments><description>Just a few short weeks ago, we shipped WebMatrix Beta 2 .&amp;#160; We fixed a lot of bugs and stabilized the product overall in that release.&amp;#160; Beta 3 is different.&amp;#160; There are all sorts of new features to try out!&amp;#160; Download WebMatrix Beta 3...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2010/11/09/webmatrix-beta-beta-3-released.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244776" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix/">webmatrix</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/iis+news+item/">iis news item</category></item><item><title>WebMatrix Beta - Beta 2 Released!</title><link>http://blogs.msdn.com/b/rlucero/archive/2010/10/07/webmatrix-beta-beta-2-released.aspx</link><pubDate>Thu, 07 Oct 2010 15:11:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244777</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244777</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2010/10/07/webmatrix-beta-beta-2-released.aspx#comments</comments><description>Yesterday, we released a refreshed Beta 2 for WebMatrix.&amp;#160; It contains a number of bug fixes and feature improvements over Beta 1.&amp;#160; Highlights include: New and updated Razor templates Feedback and bug fixes as suggested by the community on Microsoft...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2010/10/07/webmatrix-beta-beta-2-released.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244777" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix/">webmatrix</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/iis+news+item/">iis news item</category></item><item><title>WebMatrix Beta – Database Migration and Live Database Monitoring</title><link>http://blogs.msdn.com/b/rlucero/archive/2010/07/19/webmatrix-beta-database-migration-and-live-database-monitoring.aspx</link><pubDate>Mon, 19 Jul 2010 17:04:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244778</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244778</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2010/07/19/webmatrix-beta-database-migration-and-live-database-monitoring.aspx#comments</comments><description>One of the cool WebMatrix features is the ability to manage other databases from within the WebMatrix Databases Workspace.&amp;#160; This post describes a scenario where you can take an existing SQL Compact Edition database from a template site, migrate it...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2010/07/19/webmatrix-beta-database-migration-and-live-database-monitoring.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244778" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix/">webmatrix</category></item><item><title>WebMatrix Beta – Testing With ‘Real’ Certificates</title><link>http://blogs.msdn.com/b/rlucero/archive/2010/07/16/webmatrix-beta-testing-with-real-certificates.aspx</link><pubDate>Fri, 16 Jul 2010 16:14:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244779</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244779</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2010/07/16/webmatrix-beta-testing-with-real-certificates.aspx#comments</comments><description>In my last post, one of the tips I described was how to configure a WebMatrix site to use the built-in test SSL certificate.&amp;#160; If you enable SSL for a site within WebMatrix and browse to it using the link in the UI, you’ll probably receive a glaring...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2010/07/16/webmatrix-beta-testing-with-real-certificates.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244779" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix/">webmatrix</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/certificates/">certificates</category></item><item><title>WebMatrix Beta - Tips and Tricks</title><link>http://blogs.msdn.com/b/rlucero/archive/2010/07/09/webmatrix-beta-tips-and-tricks.aspx</link><pubDate>Fri, 09 Jul 2010 16:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244780</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244780</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2010/07/09/webmatrix-beta-tips-and-tricks.aspx#comments</comments><description>Here’s a short list of really cool features to try out in the new WebMatrix : Use Web Platform Installer v3.0 Beta to install Apps to both WebMatrix and IIS Manage and Maintain Other Databases from WebMatrix Perform SEO Analysis and Review Reports on...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2010/07/09/webmatrix-beta-tips-and-tricks.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244780" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/webmatrix/">webmatrix</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/iis+news+item/">iis news item</category></item><item><title>Client Certificates, Now with a UI!</title><link>http://blogs.msdn.com/b/rlucero/archive/2009/10/13/client-certificates-now-with-a-ui.aspx</link><pubDate>Tue, 13 Oct 2009 16:42:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244781</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244781</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2009/10/13/client-certificates-now-with-a-ui.aspx#comments</comments><description>Dave , a test lead at IIS, sent me a link to Puneet Gupta’s blog post about the Client Certificates UI that he developed. One of the more common requests we get on the IIS 7 UI team is for a Client Certificates UI Module.&amp;#160; Puneet took advantage of...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2009/10/13/client-certificates-now-with-a-ui.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244781" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/IIS7/">IIS7</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/Extensibility/">Extensibility</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/certificates/">certificates</category></item><item><title>IIS Database Manager – Version 1.0 Released!</title><link>http://blogs.msdn.com/b/rlucero/archive/2009/09/25/iis-database-manager-version-1-0-released.aspx</link><pubDate>Fri, 25 Sep 2009 20:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244782</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244782</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2009/09/25/iis-database-manager-version-1-0-released.aspx#comments</comments><description>Today, the IIS team is releasing version 1.0 of the IIS Database Manager. It allows you to administer website and web application databases with the existing connection string or a custom client connection with an IIS UI extension. Major Features: Viewing...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2009/09/25/iis-database-manager-version-1-0-released.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244782" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/UI/">UI</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/IIS7/">IIS7</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/iis+news+item/">iis news item</category></item><item><title>Certificate Renewals in IIS 7</title><link>http://blogs.msdn.com/b/rlucero/archive/2009/05/28/certificate-renewals-in-iis-7.aspx</link><pubDate>Thu, 28 May 2009 20:53:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10244783</guid><dc:creator>Robert Lucero</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/rlucero/rsscomments.aspx?WeblogPostID=10244783</wfw:commentRss><comments>http://blogs.msdn.com/b/rlucero/archive/2009/05/28/certificate-renewals-in-iis-7.aspx#comments</comments><description>Certificate renewals have changed from IIS 6 to IIS 7.&amp;#160; Specifically, IIS 7 generates a different type of certificate renewal. The way it was… IIS 6 creates a PKCS #10 type of renewal.&amp;#160; This is essentially just a new request with the information...(&lt;a href="http://blogs.msdn.com/b/rlucero/archive/2009/05/28/certificate-renewals-in-iis-7.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10244783" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/IIS7/">IIS7</category><category domain="http://blogs.msdn.com/b/rlucero/archive/tags/certificates/">certificates</category></item></channel></rss>