<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Eric's Blog</title>
  <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/" />
  <link rel="self" href="http://www.nextivr.com/ericp/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2008-04-09T11:49:04.6694269-07:00</updated>
  <author>
    <name>Eric Phetteplace</name>
  </author>
  <subtitle>Everything Speech and IVR</subtitle>
  <id>http://www.nextivr.com/ericp/</id>
  <generator uri="http://www.dasblog.net" version="1.8.5223.2">DasBlog</generator>
  <entry>
    <title>Transcribing for MS Speech Server</title>
    <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/PermaLink,guid,a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb.aspx" />
    <id>http://www.nextivr.com/ericp/PermaLink,guid,a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb.aspx</id>
    <published>2008-04-09T11:49:04.6694269-07:00</published>
    <updated>2008-04-09T11:49:04.6694269-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
   Transcribing speech utterances is a highly repetitive task, usually performed by a
   pool of people who are good at typing.<br /><br />
   Out of the box, the speech server tools for transcribing are accessible through Visual
   Studio, and are not good for transcribing any volume of utterances.<br /><br />
   The following attachment contains two Visual Studio 2005 projects that can get you
   on your way towards a fast transcription process for non developers (no Visual Studio
   needed for them).<br /><br /><br /><a href="http://www.nextivr.com/ericp/content/binary/MSSTranscriptionService.zip">MSSTranscriptionService.zip
   (3.75 MB)</a><img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=a1f1c1eb-b3db-4da6-9c11-7bf3d544edeb" /></div>
    </content>
  </entry>
  <entry>
    <title>Unit Testing Managed Speech Server Applications</title>
    <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/PermaLink,guid,f7f2d34b-368c-476d-8ac3-86a71f217f7f.aspx" />
    <id>http://www.nextivr.com/ericp/PermaLink,guid,f7f2d34b-368c-476d-8ac3-86a71f217f7f.aspx</id>
    <published>2008-04-03T10:13:06.4310000-07:00</published>
    <updated>2008-04-08T13:09:01.9594559-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Unit testing code is important. If you make code changes in a library that other people
      are using, you want to make sure all of the code works as expected. Using NUnit is
      great for that.
   </p>
        <p>
      However, when it comes to speech applications, you probably manually test your applications
      before each release.
   </p>
        <p>
      If you are writing managed code for Office Communications Server 2007 Speech Server,
      and you are using a SIP for your telephony lines, I have something that will help
      you automate your testing. I created a simple class that will send SIP INFO requests
      to the caller if they include "log=true" in the SIP URI parameters. It basically works
      like this:
   </p>
        <ol>
          <li>
         Call into your application and then generate a test script based on the call log. 
      </li>
          <li>
         Run the customized OutboundCalls application, passing your newly generated script
         as the script to run. 
      </li>
          <li>
         The OutboundCalls application will automatically go through the application, following
         the same path. 
      </li>
        </ol>
        <p>
      Attached is the unit testing code, a demo and some basic instructions. Open the UnitTesting
      solution and read the ReadMe.htm file for all the details.
   </p>
        <p>
      Happy Testing!
   </p>
        <a href="http://www.nextivr.com/ericp/content/binary/UnitTesting.zip">UnitTesting.zip
   (8 MB)</a>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=f7f2d34b-368c-476d-8ac3-86a71f217f7f" />
      </div>
    </content>
  </entry>
  <entry>
    <title>A Grammar for AlphaNumeric IDs</title>
    <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/PermaLink,guid,fb6fd509-52db-47fa-9dc3-3e343cbc8113.aspx" />
    <id>http://www.nextivr.com/ericp/PermaLink,guid,fb6fd509-52db-47fa-9dc3-3e343cbc8113.aspx</id>
    <published>2007-06-05T08:02:22.2150000-07:00</published>
    <updated>2007-06-05T08:07:33.3332376-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      In the health industry, I've frequently run into the following predicament: 
      User IDs are no longer simple numeric fields.  Traditionally, an employee's Social
      Security number may have been used as an id, but HIPAA has put an end to that.
   </p>
        <p>
      For speech recognition, this could present a common tuning and maintenance issue. 
      The following XSLT document is designed to automate this maintenance.
   </p>
        <p>
      First, let's take a look at some simple user IDs stored in my sample database.
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> UserIDs <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> SampleIDs</span>
        </p>
        <p>
      UserIDs                                                      
      <br />
      ------<br />
      119821<br />
      319871<br />
      31987M<br />
      D19821<br />
      D1982M<br />
      D19871<br />
      ...
   </p>
        <p>
      You can see there are a few alphanumeric patterns being used with these IDs. 
      Using a simple replacement, we can get all the non-numeric patterns in the database:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span>
            <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(UserIDs, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'1'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'2'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'3'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'4'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'5'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'6'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'7'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'8'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'9'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'0'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> Pattern, 
      <br /><span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">COUNT</span>(*) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> RecordCount 
      <br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> SampleIDs<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">GROUP</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span><span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">REPLACE</span>(UserIDs, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'1'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'2'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'3'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'4'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'5'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'6'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'7'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'8'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'9'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>), <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'0'</span>, <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'_'</span>)<br /><br /></span>
        </p>
        <p>
      Pattern RecordCount 
      <br />
      ------------------- 
      <br />
      D_____  71680<br />
      _____M  57344<br />
      X____M  14336<br />
      D____M  71680<br />
      X_____  14336<br />
      ______  57344
   </p>
        <p>
      With this, we'll simply assume there is an even chance for any of these patterns being
      used on a call.  So, D_____ has the probability of 71680/286720 or a 25% chance
      of being provided.  Using this information, we can weight the probability of
      this pattern matching an utterance for a user ID.
   </p>
        <p>
      First, I run the above SQL statement and put the results into a dataset.  You
      can simply create the XML from the recordset, too.  My XML results look like
      this:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;records&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;D_____&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;71680&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;_____M&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;57344&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;X____M&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;14336&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;D____M&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;71680&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;X_____&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;14336&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;record&gt;<br />
      &lt;Pattern&gt;______&lt;/Pattern&gt;<br />
      &lt;RecordCount&gt;57344&lt;/RecordCount&gt;<br />
      &lt;/record&gt;<br />
      &lt;/records&gt;<br /><br /></span>
        </p>
        <p>
      Now comes the fun part - using XSLT to create a GRXML grammar file.
   </p>
        <p>
      A couple of points about the XSL file:
   </p>
        <ol>
          <li>
         For the JavaScript function buildCharacterArray(s1), you could probably slim the function
         down to "return s1.split('');"  It splits a string into a character array. 
      </li>
          <li>
         XSLT doesn't have a for-each loop, so I recursively call the buildItem template. 
      </li>
          <li>
         In this example, the TAG is set as an attribute of the related ITEM element. 
         For other platforms, this may need to be an element trailing the ITEM element. 
         Of course, the tag syntax is different on each platform:( 
      </li>
          <li>
         In the real world you may find, through transcriptions and tuning, that people may
         utter dashes and spaces, too, or say, "B as in boy."  They may also truncate
         leading 0's (00001214V may be spoken 1214V). 
      </li>
          <li>
         It doesn't handle robust recognition for utterances like "nine double oh one seven"
         or "nine thirty nine twenty two."  Unless you find patterns through transcriptions
         and tuning, effectively accommodating this will drop your accuracy and performance
         through the floor. 
      </li>
          <li>
         Use your web server to cache the GRXML output; there's no need to run it too often.</li>
        </ol>
        <p>
      The resulting grammar looks like this :<br /></p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;?xml
      version=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"1.0"</span> encoding=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"utf-8"</span> ?&gt; 
      <br />
      &lt;grammar xml:lang=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"en-US"</span> version=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"1.0"</span> root=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"main"</span> mode=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"voice"</span> xmlns:msxsl=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"urn:schemas-microsoft-com:xslt"</span> xmlns:nextivr=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"http://www.nextivr.com/XSLFunctions"</span> xmlns:rs=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"urn:schemas-microsoft-com:rowset"</span>&gt;<br />
      &lt;rule id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"main"</span> scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"public"</span>&gt;<br />
      &lt;one-of&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.25"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#D_____"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.2"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#_____M"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.05"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#X____M"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.25"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#D____M"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.05"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#X_____"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> weight=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0.2"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#______"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;<br />
      &lt;/one-of&gt;<br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"D_____"</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"D"</span>&gt;D&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"_____M"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"M"</span>&gt;M&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"X____M"</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"X"</span>&gt;X&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"M"</span>&gt;M&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"D____M"</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"D"</span>&gt;D&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"M"</span>&gt;M&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"X_____"</span>&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"X"</span>&gt;X&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"______"</span>&gt;<br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;ruleref type=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"application/srgs+xml"</span> uri=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#number"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt; 
      <br />
      &lt;/rule&gt;<br />
      &lt;rule scope=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"private"</span> id=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"number"</span>&gt;<br />
      &lt;one-of&gt;<br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"1"</span>&gt;one&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"2"</span>&gt;two&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"3"</span>&gt;three&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"4"</span>&gt;four&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"5"</span>&gt;five&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"6"</span>&gt;six&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"7"</span>&gt;seven&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"8"</span>&gt;eight&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"9"</span>&gt;nine&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span> tag=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"0"</span>&gt;zero&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt; 
      <br />
      &lt;/one-of&gt;<br />
      &lt;/rule&gt;<br />
      &lt;/grammar&gt;<br /><br /><a href="content/binary/AlphaNumIDsToGrammar.zip">Download the code!</a><br /><br /></span>
        </p>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=fb6fd509-52db-47fa-9dc3-3e343cbc8113" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Url2Fax, free FAX software with source code, converting web pages to FAX documents.</title>
    <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/PermaLink,guid,9f15277b-bebf-4c17-8181-87eb8ceb7ede.aspx" />
    <id>http://www.nextivr.com/ericp/PermaLink,guid,9f15277b-bebf-4c17-8181-87eb8ceb7ede.aspx</id>
    <published>2007-05-11T08:21:20.9910000-07:00</published>
    <updated>2007-05-23T10:15:35.1368950-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I needed to add some simple, free FAX functionality to an application, so I invested
      a little time in doing it with <a href="http://msdn.microsoft.com/vstudio/express">Visual
      C# 2005 Express Edition</a>. 
   </p>
        <p>
      Source from the web: 
      <br /><a href="http://www.nextivr.com/ericp/content/binary/news.google.com.JPG"><img style="WIDTH: 33.11%; HEIGHT: 78.13%" src="http://www.nextivr.com/ericp/content/binary/news.google.com.JPG" border="0" /></a><br />
      Resulting image: 
      <br /><a href="http://www.nextivr.com/ericp/content/binary/news.google.com.gif"><img style="WIDTH: 33.11%; HEIGHT: 78.13%" src="http://www.nextivr.com/ericp/content/binary/news.google.com.gif" border="0" /></a></p>
        <p>
      I decided to make it use web browser content; seeing that it's pretty easy to format
      a web page, no FAX imaging tools are required. Thanks to <a href="http://www.codeproject.com/script/Articles/list_articles.asp?userid=564301">Michael
      McCloskey's</a>  Bitonal article <a href="http://www.codeproject.com/cs/media/BitonalImageConverter.asp">Bitonal
      (TIFF) Image Converter for .NET</a>, I was able to accomplish my goal rather easily! 
   </p>
        <p>
      I added in some random dithering to produce a decent balance between text pages and
      pages with images. I was tempted to implement <a href="http://www.visgraf.impa.br/Courses/ip00/proj/Dithering1/floyd_steinberg_dithering.html">Floyd-Steinberg
      Dithering</a>, but my random results are good enough for my project. 
   </p>
        <p>
      I also added in code for generating the image from a web page, and creating the multi-page
      TIFF document.
   </p>
        <p>
      I reference FaxComEx.dll, the Windows FAX server, in the code.  This makes it
      easy to generate a FAX by the command line, <em>(e.g. <u>Url2Fax http://localhost/reportapp/report.jsp?repnum=1
      18885551212 FAXSVR100 will send a report to 8885551212, using the fax printer on FAXSVR100
      (don't use "localhost")</u>)</em>   If you don't want to use the FAX service,
      leave off the parameters.  You can grab the image from your %TEMP% directory.
   </p>
        <p>
      Here's the source code: <a href="http://www.nextivr.com/ericp/content/binary/Url2Fax.zip">Url2Fax.zip</a>. 
      The exe is located in the release folder, in case you want to try it as is. 
      You'll need Windows XP or 2003 to use the built-in Fax delivery.  For Windows
      2000, you can generate the image and then send it with the Windows 2000 fax server.
      (I have a script for that, too).
   </p>
        <p>
          <br />
      Enjoy! 
   </p>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=9f15277b-bebf-4c17-8181-87eb8ceb7ede" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Creating Dynamic GRXML Grammars with c# and ASP.NET</title>
    <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/PermaLink,guid,953266f9-21db-45ae-bb08-9c524b6edfd4.aspx" />
    <id>http://www.nextivr.com/ericp/PermaLink,guid,953266f9-21db-45ae-bb08-9c524b6edfd4.aspx</id>
    <published>2007-05-02T16:58:11.8160000-07:00</published>
    <updated>2007-05-02T17:00:30.9140683-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      One of the fundamental tasks in creating speech applications is building the grammars
      for automated speech recognition (ASR).  This entry features techniques to make
      your grammar-building code fast, efficient and maintainable.
   </p>
        <p>
      In many situations, it is unrealistic to design and build your grammars in development
      and deploy them as static grammars in production.  For example, if you are writing
      an address verification application, you may want to ask the caller for the state,
      then the city, then the street and so on.  Instead of building many grammars
      (all the streets in each city, all the cities in each state), you may want to let
      the user activity decide which of the most popular cities have their street grammars
      created, and the most popular states have their city grammars cached, too, and so
      on. 
   </p>
        <p>
      I tried three methods for performing this task.  In all the examples, I connected
      to a database to retrieve choices for the <a href="http://www.nextivr.com/ericp/EditEntry.aspx#f5">grammar</a>.<br />
      In the <a href="http://www.nextivr.com/ericp/EditEntry.aspx#f1">first example</a>,
      I wrote directly to a stream, writing the xml using strings.  In the <a href="http://www.nextivr.com/ericp/EditEntry.aspx#f2">next
      example</a>, I used an XML dataset and an <a href="http://www.nextivr.com/ericp/EditEntry.aspx#f4">XSL
      stylesheet</a> to transform the data to a grammar.  In the <a href="http://www.nextivr.com/ericp/EditEntry.aspx#f3">third
      example</a>, I did the same as the second example, but I sent the results directly
      to a Response stream in ASP.NET.  Figures 1, 2 and 3 repsectively provide samples
      of the code.
   </p>
        <p>
      All 3 performed well.  Using a simple performance measurement of the total processor
      time used, they were all a fraction of a second.  The top performer by far was
      using ASP.NET and the response stream.  Of course, IO is the performance killer
      for the first two; writing the file to a disk address is slow compared to writing
      to a memory address.
   </p>
        <h5>Total seconds of processor time.
   </h5>
        <table border="1">
          <tbody>
            <tr>
              <td bgcolor="#cccccc">
              </td>
              <td bgcolor="#aaaaaa" colspan="3">
               Code sample</td>
            </tr>
            <tr>
              <td bgcolor="#cccccc">
               Grammar Items</td>
              <td bgcolor="#aaaaaa">
               Code 1</td>
              <td bgcolor="#aaaaaa">
               Code 2</td>
              <td bgcolor="#aaaaaa">
               Code 3</td>
            </tr>
            <tr>
              <td bgcolor="#cccccc">
               10</td>
              <td>
               0.891</td>
              <td>
               0.938</td>
              <td>
               0.000!</td>
            </tr>
            <tr>
              <td bgcolor="#cccccc">
               100</td>
              <td>
               0.906</td>
              <td>
               0.984</td>
              <td>
               0.012</td>
            </tr>
            <tr>
              <td bgcolor="#cccccc">
               1000</td>
              <td>
               0.938</td>
              <td>
               1.141</td>
              <td>
               0.141</td>
            </tr>
          </tbody>
        </table>
        <p>
          <br />
      So of course, I suggest you use the code in Figure 3.  Here are some tips on
      why I think you should prefer it over the code in Figure 1.
   </p>
        <ul>
          <li>
         If you need to customize the grammar, you can change the XSL file without recompiling
         the code.  Let's say you need to change the TAG element in the grammar (and for
         each VoiceXML platform, tags are implemented differently!), you can adjust the XSL
         file and see visually how you're affecting the grammar. 
      </li>
          <li>
         By using the XML from the DataSet, you don't have to worry about data types as they're
         all converted to text.  If a database field changes in size or precision, the
         code still works without recompiling. 
      </li>
          <li>
         XSL is easier to read.  Mind you, to master it takes some work, but which code
         is easier for an IVR programmer to pick up...<br /><u>This:</u>               
         <p><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">while</span>(TestDataReader.Read())<br />
            {<br />
            TestWriter.Write(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;item&gt;{0}&lt;/item&gt;&lt;tag&gt;colorid
            = {1};&lt;/tag&gt;"</span>, TestDataReader.GetString(1), TestDataReader.GetInt32(0));<br />
            } </span><br /><u>Or this?</u><br /><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;xsl:<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">for</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">each</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">select</span>=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"//record"</span>&gt;<br />
            &lt;<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;&lt;xsl:value-of <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">select</span>=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"description"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt;&lt;/<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">item</span>&gt;&lt;tag&gt;colorid <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> &lt;xsl:value-of <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">select</span>=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"id"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span>&gt;;&lt;/tag&gt; 
            <br />
            &lt;/xsl:<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">for</span>-<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">each</span>&gt;<br /></span></p></li>
          <li>
         Using Page Output Caching <a href="http://msdn2.microsoft.com/en-us/library/ms972362.aspx">http://msdn2.microsoft.com/en-us/library/ms972362.aspx</a> you
         can get great performance from the dynamic grammars.  Cache the files fresh every
         day, based on the URL parameters.  Schedule a task to call the common URLs, so
         the first caller of the day doesn't have to wait for the first compile (even though
         it's a fraction of a second).  Cache based on a database dependency - there's
         examples out there on how to do this. 
      </li>
          <li>
         Use web.config to store the SQL queries and XSL file names.  That'll make this
         code grammar builder really flexible.</li>
        </ul>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
       <u>In web.config</u><br />
       &lt;configuration&gt;<br />
        &lt;appSettings&gt;<br />
         &lt;add key="colors" value="SELECT id, description FROM colors"
      /&gt;<br />
         &lt;add key="colorsxsl" value="SimpleGrammarTransformer.xsl" /&gt;
   </p>
          <p>
       <u>In your code replace the SQL query with the following:<br /></u>  System.Configuration.ConfigurationSettings.AppSettings[Request.QueryString.Get("grammar_id")]
   </p>
          <p>
            <u> URL to get the colors grammar: </u>
            <br />
        <a href="http://servername/BuildGrammar?grammar_id=colors">http://servername/BuildGrammar?grammar_id=colors</a></p>
        </blockquote>
        <ul>
          <li>
         Use a SCRIPT block in the XSL to manipulate the data, instead of doing it in the compiled
         code.  Using script makes it easy to perform Javascript on the XML as it's being
         processed by the XSL stylesheet.  I've used Javascript to parse comma-delimited
         strings into grammar items, clean up data, and more.  Perhaps if you need an
         example, I can post one...</li>
        </ul>
        <p>
      In conclusion, you should use ASP.NET and XSLT to create your dynamic grammars. 
      It's fast, flexible and easy.  Let me know what you think.  Should I include
      a download, or can you take if from here?
   </p>
        <p>
      Have fun!
   </p>
        <p>
          <a name="f1">
            <strong>Figure 1 - Reading from a DB, writing strings to a stream<br /></strong>
          </a>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Main(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>[]
      args)<br />
      {<br />
      TimeSpan TS1 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br /><br />
      MySqlConnection DatabaseConnection <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlConnection(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Database=;Data
      Source=;User Id=;Password="</span>);<br />
      DatabaseConnection.Open();<br />
      MySqlCommand TestCommand <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlCommand(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SELECT
      id, description FROM colors"</span>, DatabaseConnection);<br />
      MySql.Data.MySqlClient.MySqlDataReader TestDataReader <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> TestCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection);<br />
      System.IO.StreamWriter TestWriter <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> System.IO.StreamWriter(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"c:\\temp\\Grammar2.grxml"</span>);<br /><br />
      TestWriter.Write(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;?xml
      version=\"1.0\" encoding=\"utf-8\"?&gt;&lt;grammar mode=\"voice\" version=\"1.0\"
      root=\"main\"&gt;&lt;rule id=\"main\"&gt;&lt;one-of&gt;"</span>);<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (TestDataReader.HasRows)<br />
      {<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">while</span>(TestDataReader.Read())<br />
      {<br />
      TestWriter.Write(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;item&gt;{0}&lt;/item&gt;&lt;tag&gt;colorid
      = {1};&lt;/tag&gt;"</span>, TestDataReader.GetString(1), TestDataReader.GetInt32(0));<br />
      } 
      <br /><br />
      }<br /><br />
      TestWriter.Write(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;/one-of&gt;&lt;/rule&gt;&lt;/grammar&gt;"</span>);<br />
      TestWriter.Close();<br /><br />
      TimeSpan TS2 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br />
      Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Done.
      Total ticks = {0}."</span>, TS2.Subtract(TS1).Ticks.ToString());<br />
      Console.ReadLine();<br /><br />
      }<br /></span>
        </p>
        <a name="f2">
          <p>
            <strong>Figure 2 - Reading from a DB to a DataSet, then transforming with XSLT.<br /></strong>
          </p>
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span>
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Main(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>[]
      args)<br />
      {<br />
      TimeSpan TS1 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br /><br />
      MySqlConnection DatabaseConnection <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlConnection(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Database=;Data
      Source=;User Id=;Password="</span>);<br />
      MySqlDataAdapter DataAdapter <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlDataAdapter(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SELECT
      id, description FROM colors"</span>, DatabaseConnection);<br />
      System.Data.DataSet DBDataSet <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> System.Data.DataSet();<br />
      DataAdapter.Fill(DBDataSet, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"record"</span>);<br />
      XmlDocument XMLTarget <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> XmlDocument();<br />
      XMLTarget.LoadXml(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;records&gt;"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> DBDataSet.GetXml() <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;/records&gt;"</span>);<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> XmlTempFile <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"c:\\temp\\temprecords.xml"</span>;<br />
      XMLTarget.Save(XmlTempFile);<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> XslFile <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"file://c:/temp/SimpleGrammarTransformer.xsl"</span>;<br />
      System.Xml.Xsl.XslTransform StyleSheet <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> System.Xml.Xsl.XslTransform();<br />
      XmlUrlResolver URLResolver <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> XmlUrlResolver();<br />
      StyleSheet.Load(XslFile);<br />
      StyleSheet.Transform(XmlTempFile, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"c:\\temp\\Grammar1.grxml"</span>);<br /><br />
      TimeSpan TS2 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br />
      Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Done.
      Total ticks = {0}."</span>, TS2.Subtract(TS1).Ticks.ToString());<br />
      Console.ReadLine();<br />
      }<br /><br /></span>
          </p>
          <a name="f3">
            <p>
              <strong>Figure 3 - Reading from a DB and transforming the results to the response
      stream.<br /></strong>
            </p>
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;%@
      Page Language=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"c#"</span> AutoEventWireup=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"false"</span> Debug=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"true"</span> %&gt;&lt;%@
      Import <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span>=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"System.Xml"</span>%&gt;&lt;%@
      Import <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span>=<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"MySql.Data.MySqlClient"</span>%&gt;&lt;%<br /><br />
      TimeSpan TS1 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br /><br />
      MySqlConnection DatabaseConnection <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlConnection(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Database=;Data
      Source=;User Id=;Password="</span>);<br />
      MySqlDataAdapter DataAdapter <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> MySqlDataAdapter(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SELECT
      id, description FROM colors"</span>, DatabaseConnection);<br />
      System.Data.DataSet DBDataSet <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> System.Data.DataSet();<br />
      DataAdapter.Fill(DBDataSet, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"record"</span>);<br />
      XmlDocument XMLTarget <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> XmlDocument();<br />
      XMLTarget.LoadXml(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;records&gt;"</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span> DBDataSet.GetXml() <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">+</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;/records&gt;"</span>);<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> XslFile <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> String.Format(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"file://{0}"</span>,
      Server.MapPath(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"SimpleGrammarTransformer.xsl"</span>)).Replace(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"\\"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"/"</span>);<br />
      System.Xml.Xsl.XslTransform StyleSheet <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> System.Xml.Xsl.XslTransform();<br />
      XmlUrlResolver URLResolver <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> XmlUrlResolver();<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//StyleSheet.Load(XslFile,
      URLResolver);</span><br />
      StyleSheet.Load(XslFile, URLResolver);<br /><br />
      StyleSheet.Transform(XMLTarget, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>,
      Response.OutputStream, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>);<br /><br />
      TimeSpan TS2 <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;<br /><br />
      Response.Write(String.Format(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;!--Done.
      Total ticks = {0} .--&gt;"</span>, TS2.Subtract(TS1).Ticks.ToString()));<br /><br />
      %&gt;<br /></span>
            </p>
            <a name="f4">
              <p>
                <strong>Figure 4 - An XSLT file for building GRXML grammars</strong>
              </p>
              <p>
      You can always change this so it outputs ABNF, or any GSL.
   </p>
              <p>
                <br />
      &lt;?xml version="1.0"?&gt;<br />
      &lt;xsl:stylesheet version="1.0" 
      <br />
        xmlns:xsl="<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>" 
      <br />
        xmlns:msxsl="urn:schemas-microsoft-com:xslt"<br />
        exclude-result-prefixes="msxsl"<br />
      &gt;<br />
      &lt;xsl:output method="xml"/&gt;<br />
        &lt;xsl:template match="/"&gt;<br />
          &lt;grammar mode="voice" version="1.0" root="main" &gt;<br />
            &lt;rule id="main"&gt;<br />
              &lt;one-of&gt;<br />
                &lt;xsl:for-each select="//record"&gt;<br />
                  &lt;item&gt;&lt;xsl:value-of
      select="description"/&gt;&lt;/item&gt;&lt;tag&gt;colorid = &lt;xsl:value-of select="id"/&gt;;&lt;/tag&gt;          
      <br />
                &lt;/xsl:for-each&gt;<br />
              &lt;/one-of&gt;<br />
            &lt;/rule&gt;<br />
          &lt;/grammar&gt;<br />
        &lt;/xsl:template&gt;<br />
      &lt;/xsl:stylesheet&gt;
   </p>
              <p>
                <br />
                <strong>Figure 5 - GRXML result<br /></strong>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
      &lt;grammar mode="voice" version="1.0" root="main"&gt;<br />
        &lt;rule id="main"&gt;<br />
        &lt;one-of&gt;<br />
          &lt;item&gt;red&lt;/item&gt;&lt;tag&gt;colorid = 1;&lt;/tag&gt;<br />
          &lt;item&gt;orange&lt;/item&gt;&lt;tag&gt;colorid = 2;&lt;/tag&gt;<br />
          &lt;item&gt;yellow&lt;/item&gt;&lt;tag&gt;colorid = 3;&lt;/tag&gt;<br />
          .<br />
          .<br />
          .    
      <br />
        &lt;/one-of&gt;<br />
        &lt;/rule&gt;<br />
      &lt;/grammar&gt;
   </p>
              <p>
       
   </p>
              <font face="Courier New" color="#000000">
              </font>
              <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=953266f9-21db-45ae-bb08-9c524b6edfd4" />
            </a>
          </a>
        </a>
      </div>
    </content>
  </entry>
  <entry>
    <title>Natural Microsystems Vox Wav files</title>
    <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/PermaLink,guid,6c9df242-1603-4752-8814-04e98f30d9bc.aspx" />
    <id>http://www.nextivr.com/ericp/PermaLink,guid,6c9df242-1603-4752-8814-04e98f30d9bc.aspx</id>
    <published>2007-03-07T08:02:13.2297751-07:00</published>
    <updated>2007-03-07T08:02:13.2297751-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Hi All,
   </p>
        <p>
      Seeing that some of the google search traffic I receive is around NMS sound files,
      let me provide a little insight.
   </p>
        <p>
      NMS sound files are recorded in their own proprietary format, optimized for quality
      and performance.
   </p>
        <p>
      The NMS vox files are NOT the same as the Dialogic VOX files.
   </p>
        <p>
      If you have some NMS VOX files that you need to convert, the easiest way is to convert
      them where some NMS software is installed (probably on the IVR machine itself).
   </p>
        <p>
      Here's a Windows command line command to convert a folder of  NMS files to WAV
      files:
   </p>
        <p>
          <strong>for %1 in (*.vox) do VCECOPY %1 %~n1.wav -c44M16</strong>
        </p>
        <p>
      -c44M16 means output encoding is 44mhz mono 16-bit.
   </p>
        <p>
      If the NMS file is indexed (use VCEINFO to figure it out), meaning it contains more
      than one recording - kind of like a ZIP file contains a bunch of files - you'll have
      to use a manual technique something like the following:
   </p>
        <p>
      vcecopy messages.vox 0.wav -c44M16 -m0,0
   </p>
        <p>
      vcecopy messages.vox 1.wav -c44M16 -m1,0
   </p>
        <p>
      vcecopy messages.vox 2.wav -c44M16 -m2,0
   </p>
        <p>
      Using Excel, you can write some equations to build a list of commands.  Using
      some advanced command line utilities - perhaps Windows PowerShell or grep, depending
      on the platform you are using.
   </p>
        <p>
      If you need any help with decoding/encoding from one format to another, drop me a
      line.  NMS, Dialogic, Talx, raw PCM, GSM, whatever...
   </p>
        <p>
       
   </p>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=6c9df242-1603-4752-8814-04e98f30d9bc" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Arca and Asterisk</title>
    <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/PermaLink,guid,3630c627-6f15-47c6-92fe-055d95090c1a.aspx" />
    <id>http://www.nextivr.com/ericp/PermaLink,guid,3630c627-6f15-47c6-92fe-055d95090c1a.aspx</id>
    <published>2006-08-18T13:20:29.9410000-07:00</published>
    <updated>2006-08-18T13:20:29.9417109-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Seeing that it's been a while, I figure I can let you know what I'm up to.  I've
      been programming for clients; some VoiceXML, some web apps, some legacy IVRs.
   </p>
        <p>
      In my spare time I've been building out an Asterisk adapter for our Arca applications. 
      It's pretty easy to install, etc.  Basically, our IVR applications can be written
      once and run on VoiceXML, MSS, proprietary IVR platforms, and "non-standard" IVRs
      like Asterisk.
   </p>
        <p>
      If you're curious about Asterisk but know nothing about Linux, I can have you running
      an Asterisk switch on your workstation in two hours.
   </p>
        <p>
      If you're curious about Arca, let me know.  We have videos of how it all works.
   </p>
        <p>
      If you have any general IVR questions - any platform, any topic - drop me a line!
   </p>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=3630c627-6f15-47c6-92fe-055d95090c1a" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Playing a WAV on a Phone Card</title>
    <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/PermaLink,guid,9233bc81-358a-40bc-b4c9-35cc782a3d98.aspx" />
    <id>http://www.nextivr.com/ericp/PermaLink,guid,9233bc81-358a-40bc-b4c9-35cc782a3d98.aspx</id>
    <published>2006-05-16T06:27:54.5660000-07:00</published>
    <updated>2006-05-16T06:27:54.5662569-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I had someone ask, "Why is it that my cheap $20 sound card can play more sounds than
      a telephony card that costs thousands of dollars?"  He was asking about a quad
      span T1 he purchased for his IVR application.  Basically, a T1 is an ethernet
      connection that can manage 24 phone lines (30 outside of the USA).  In the world
      of IVRs, it's a lot easier to wire, and manage, a single ethernet connection
      instead of wiring 24 analog phone lines.
   </p>
        <p>
      First, let me provide some background on telephony cards.  I'll address why they're
      so expensive, and then I'll address the WAV part of the question.
   </p>
        <p>
      Basically, a telephony card offloads the telephony processing from the PC's CPUs,
      making it easy for apps to place a call, play a sound file, collect DTMF or request
      speech recognition, transfer a call and so on.  Just like you have video and
      audio processors in your PC handling all of the video and audio signaling.
   </p>
        <p>
      Here are some of the processing tasks handled by telephony.
   </p>
        <h4>Multiplexing
   </h4>
        <p>
      The phone company takes 24 phone lines assigned to you, digitizes the signal, and
      merges the results into one big data stream.  On the other end the telephony
      card takes the signal and starts breaking up that stream like a poker dealer. 
      Well, this dealer has 24 players to deal to.  Every few milliseconds he deals
      a little bit of signal to a phone line and then moves on to the next one.  Technically,
      this is Time-Division Multiplexing or <strong>TDM</strong>.<br /></p>
        <h4>Signaling
   </h4>
        <p>
      After multiplexing the signal, there is additional information placed in the digitized
      sound stream.  Since this is a digital signal, there is no way for an IVR system
      to perform a "flash hook" like we do at home to answer call waiting or to make a 3-way
      conference call.  The telephony card and telephone switch commonly talk to each
      other via signalling bits.  Hidden in the sound streams are bits of information
      that don't affect the audio, but provide a way for the ends to pass information.  
      <br /><em><u></u></em></p>
        <p>
          <em>
            <u>Going off on a tangent:</u>
          </em> Without going into it too much, I just want
      to say that there are many standards used to perform signaling.  Don't overlook
      this!!!  Have a technical professional install a T1 telephony card for you. 
      Otherwise you'll probably spend days trying to get it to work.  Also, how your
      IVR handles calls and flash-hooks is different on different signaling.  Some
      configurations don't support flash-hook and blind transfers so you'll have to use
      feature codes (like dialing *29 instead) or you'll have to trombone or bridge transferred
      calls.
   </p>
        <p>
          <u>
            <em>Another tangent:</em>
          </u> If you're thinking it sounds like you don't want
      to use a T1 and VOIP won't require all this overhead, think again!  VOIP has
      to handle all of this, too, but in different ways.  You can get telephony cards
      that handle all the VOIP processing for you, and they're probably easier to configure
      than a TDM T1.  If you expect to handle any kind of volume and you don't want
      to buy a telephony card of some sort, plan on dedicating a few high-grade CPUs for
      handling the telecommunications signaling and another CPU for your IVR applications. 
   </p>
        <h4>Advanced Features
   </h4>
        <p>
      Modern T1 cards have additional to make life easy on the main CPUs.  Echo cancellation
      (echoes are annoying and can confuse speech recognition, DTMF, callers...), voice
      activity detection (is someone on the line?), answering machine detection (each T1
      card vendor has their own algorithm), and conference bridging are some of these.
   </p>
        <h4>To address the cost of the card
   </h4>
        <p>
      All of the processors for handling the telephony are packed on the telephony card. 
      When your OS loads the card it can usually provide firmware files that among other
      things set up the card capabilities.  So you're spending thousands of dollars
      on a telephony card that will do a lot more than play sound files.
   </p>
        <h4>Now, on to the playing of Microsoft WAV files.
   </h4>
        <p>
      Have you ever copied a song to your hard drive as a WAV file and then converted it
      to an MP3?  Notice the size difference?  That's because WAV files are generally
      the capture of the raw digital signal received from the sound device (microphone,
      CD player, etc.)  Just like zipping a file compresses your desktop files, a CODEC
      (<strong>co</strong>de-<strong>dec</strong>ode) finds patterns in the raw sounds and
      compresses and encodes it into a smaller form.  It can also take an encoded file
      and decode it so it can be heard through your speakers or over a telephone line.
   </p>
        <p>
      So, why by default do the boards not provide a CODEC for Microsoft WAV files? 
      Well, here's my guess.  Seeing that the telecommunications industry has traditionally
      been proprietary - not into standardizing - and each board vendor would have their
      own "best compression, best quality" codec.  They also provide other common industry
      codecs to support existing methods of encoding sound files.  When you look at
      the total number of codecs, frequencies and bit-rates, you can't expect a phone channel
      to be ready to choose any of them in real time during a live call, so you usually
      load <strong>some </strong>of the codecs, not all of them.  All of the supported
      CODECs fit into a telephony card's requirements (memory, processing power, bus bandwidth)
      for playing/recording sound on 24-96 simultaneous phone calls.
   </p>
        <p>
      Microsoft WAVs are traditionally found in home and office windows-based applications. 
      They are for a single - or dual, stereo - sound channel, capable of higher quality
      than a telephone line.  There is no need for compression because the PC speakers
      are part of a whole computer system with excessive processing cycles and memory.
   </p>
        <p>
      Two different industries, two different end devices, two different requirements.
   </p>
        <p>
      Some boards may have codecs to support certain WAV formats, but if you're using uncompressed
      WAV files you're going to chew up a lot of disk space and use a lot of bandwidth between
      the sound card and the PCs disk drive (or memory cache, God willing).
   </p>
        <p>
          <u>
            <em>To be snippy:</em>
          </u>
          <br />
      Microsoft Media Player doesn't play Dialogic VOX files or Natural Microsystems VOX
      files.  Why not?  iPods don't play WAV files.  Why not?  Everyone
      uses MP3s for songs, not WAVs.  Why not?  <u>Different requirements, different
      priorities, different codecs.  Use the right codec for your system.</u></p>
        <p>
      Do you have any contentions?  Please post them!  Any IVR Sales Engineers
      out there who want to comment?  I wouldn't mind the clarification;)  If
      you're looking for audio codecs for different platforms, let me know.  I have
      access to some proprietary formats, too.
   </p>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=9233bc81-358a-40bc-b4c9-35cc782a3d98" />
      </div>
    </content>
  </entry>
  <entry>
    <title>MS Speech Server, NYC</title>
    <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/PermaLink,guid,e1eb8afb-fdb7-499b-bcf9-59bbf75fc1a2.aspx" />
    <id>http://www.nextivr.com/ericp/PermaLink,guid,e1eb8afb-fdb7-499b-bcf9-59bbf75fc1a2.aspx</id>
    <published>2006-04-19T02:56:52.4500000-07:00</published>
    <updated>2006-04-19T02:56:52.4500619-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I had a great time in NYC, presenting again for the Microsoft Speech Server Days series. 
      There were some great questions from the audience; definitely some telecom and IVR
      guys in the room!
   </p>
        <p>
      If you get a chance, write an app for the Brooktrout app contest.  Deadline is
      June 30th.  Food for thought - last year's winner linked to Microsoft's Map through
      the IVR.  I'm thinking of linking MSS into Sharepoint.  If you're on the
      road, you can see if Mary checked in that Project document, or you can listen to the
      new company annonuncements.  What do you think?  Anyone want to help?
   </p>
        <p>
      Anyway, for the PPT file, you can refer to my previous post.  If you are trying
      to remember any of the steps I did, look at the SASDK help file; it's great!
   </p>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=e1eb8afb-fdb7-499b-bcf9-59bbf75fc1a2" />
      </div>
    </content>
  </entry>
  <entry>
    <title>First entry</title>
    <link rel="alternate" type="text/html" href="http://www.nextivr.com/ericp/PermaLink,guid,ca7bc0a1-442e-4aff-9dc7-c264f1738873.aspx" />
    <id>http://www.nextivr.com/ericp/PermaLink,guid,ca7bc0a1-442e-4aff-9dc7-c264f1738873.aspx</id>
    <published>2006-04-07T07:38:23.0650000-07:00</published>
    <updated>2006-04-07T07:39:53.0674222-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Hi All,
   </p>
        <p>
      I've finally put together my blog!  After giving a presentation at Microsoft's
      Speech Server days, I realized I was the only presenter without one.  I had to
      run home and take care of that!  Overall, I'm reorganizing my NextIVR website
      to give it a new purpose - helping people with speech and IVR issues.
   </p>
        <p>
      Anyhow, I've included the presentation I gave at the seminar.  If you run through
      the tutorial in the SASDK help, you'll cover the same bases.  If you have any
      questions, let me know!
   </p>
        <a href="http://www.nextivr.com/ericp/content/binary/Session2-BuildingBasics.ppt">Session2-BuildingBasics.ppt
   (259.5 KB)</a>
        <img width="0" height="0" src="http://www.nextivr.com/ericp/aggbug.ashx?id=ca7bc0a1-442e-4aff-9dc7-c264f1738873" />
      </div>
    </content>
  </entry>
</feed>