⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch18.htm

📁 MAPI__SAPI__TAPI
💻 HTM
📖 第 1 页 / 共 5 页
字号:
  </tr>
  <tr>
    <td WIDTH="170">Numbers</td>
    <td WIDTH="317">Numbers, dates, times, and so on. </td>
  </tr>
  <tr>
    <td WIDTH="170">Spreadsheet</td>
    <td WIDTH="317">Spreadsheet document. </td>
  </tr>
  <tr>
    <td WIDTH="170"><tt><font FACE="Courier">Unknown</font></tt> </td>
    <td WIDTH="317">Context is unknown (default).</td>
  </tr>
</table>
</center></div>

<p>Setting the context helps the TTS engine better interpret the text. To test this, enter 
the text shown in Listing 18.2 into the text box. </p>

<hr>

<blockquote>
  <b><p>Listing 18.2. Testing the <tt><font FACE="Courier">Ctx</font></tt> control tag.<br>
  </b></p>
</blockquote>

<blockquote>
  <tt><font FACE="Courier"><p>\ctx=&quot;Address&quot;\<br>
  1204 W. 7th Street<br>
  Oak Ridge, TN<br>
  \ctx=&quot;E-Mail&quot;\<br>
  BillGates@msn.com<br>
  \ctx=&quot;Unknown&quot;\<br>
  129 W. First Avenue</font></tt> </p>
</blockquote>

<hr>

<p>When you press the <tt><font FACE="Courier">TextData</font></tt> button to hear the 
results, you'll notice that the TTS engine automatically converts the &quot;W.&quot; to 
&quot;West&quot; when given the <tt><font FACE="Courier">\Ctx=&quot;Address&quot;\</font></tt> 
tag but fails to do so when the <tt><font FACE="Courier">\Ctx=&quot;Unknown&quot;\</font></tt> 
tag is used. You'll also notice that the e-mail address is spoken using the phrase 
&quot;Bill Gates at msn dot com&quot; when the <tt><font FACE="Courier">\Ctx=&quot;E-Mail&quot;\</font></tt> 
tag is used. </p>

<h4>Using the <tt><font FACE="Courier">Vce</font></tt> Tag to Control Additional Voice 
Characteristics</h4>

<p>The last voice character control tag is the <tt><font FACE="Courier">Vce</font></tt> 
tag. This tag can be used to set several aspects of a voice in a single control tag. The 
exact syntax of the <tt><font FACE="Courier">Vce</font></tt> tag is </p>

<blockquote>
  <tt><font FACE="Courier"><p>\Vce=<i>chartype=string[[,chartype=string...]]</i>\</font></tt> 
  </p>
</blockquote>

<p>Several character types can be set in a single call. Microsoft has defined six 
different character type classes. These classes, along with their possible settings and 
brief descriptions, are shown in Table 18.2.<br>
</p>

<p align="center"><b>Table 18.2. The <tt><font FACE="Courier">Vce</font></tt> character 
types and their parameters.</b> </p>
<div align="center"><center>

<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
  <tr>
    <td><i>Character Type</i></td>
    <td WIDTH="402"><i>Description</i> </td>
  </tr>
  <tr>
    <td WIDTH="188">Language=<tt><i><font FACE="Courier">language</font></i></tt> </td>
    <td WIDTH="402">Tells the TTS engine to speak in the specified language. </td>
  </tr>
  <tr>
    <td WIDTH="188">Accent=<tt><i><font FACE="Courier">accent</font></i></tt> </td>
    <td WIDTH="402">Tells the TTS engine to use the specified accent. For example, if 
    Language=&quot;English&quot; and Accent=&quot;French&quot;, the engine will speak English 
    with a French accent. </td>
  </tr>
  <tr>
    <td WIDTH="188">Dialect=<tt><i><font FACE="Courier">dialect</font></i></tt> </td>
    <td WIDTH="402">Tells the TTS engine to speak in the specified dialect. </td>
  </tr>
  <tr>
    <td WIDTH="188">Gender=<tt><i><font FACE="Courier">gender</font></i></tt> </td>
    <td WIDTH="402">Used to set the gender of the voice as &quot;Male,&quot; 
    &quot;Female,&quot; or &quot;Neutral.&quot; </td>
  </tr>
  <tr>
    <td WIDTH="188">Speaker=<tt><i><font FACE="Courier">speakername</font></i></tt> </td>
    <td WIDTH="402">Specifies the name of the voice, or NULL if the name is unimportant. The 
    Microsoft Voice engine can respond using the following names: <br>
    Peter<br>
    Sidney<br>
    Eager Eddie<br>
    Deep Douglas<br>
    Biff<br>
    Grandpa Amos<br>
    Melvin<br>
    Alex<br>
    Wanda<br>
    Julia </td>
  </tr>
  <tr>
    <td WIDTH="188">Age=<tt><i><font FACE="Courier">age</font></i></tt> </td>
    <td WIDTH="402">Sets the age of the voice, which can be one of the following values:<br>
    Baby (about 1 year old)<br>
    Toddler (about 3 years old)<br>
    Child (about 6 years old)<br>
    Adolescent (about 14 years old)<br>
    Adult (between 20 and 60 years old)<br>
    Elderly (over 60 years old) </td>
  </tr>
  <tr>
    <td WIDTH="188"><tt><font FACE="Courier">Style=style</font></tt> </td>
    <td WIDTH="402">Sets the personality of the voice. For example:<br>
    <tt><font FACE="Courier">Business<br>
    Casual<br>
    Computer<br>
    Excited<br>
    Singsong</font></tt> </td>
  </tr>
</table>
</center></div>

<p>To test the <tt><font FACE="Courier">Vce</font></tt> control tag, enter the text shown 
in Listing 18.3 and press <tt><font FACE="Courier">TextData</font></tt> to hear the 
results. </p>

<hr>

<blockquote>
  <b><p>Listing 18.3. Testing the <tt><font FACE="Courier">Vce</font></tt> control tag.<br>
  </b></p>
</blockquote>

<blockquote>
  <tt><font FACE="Courier"><p>\Vce=Speaker=&quot;Sidney&quot;\<br>
  Hello there Peter.<br>
  \Vce=Speaker=&quot;Peter&quot;\<br>
  Hi Sid. How are you?<br>
  \Vce=Speaker=&quot;Sidney&quot;\<br>
  Not good really. Bad head cold.</font></tt> </p>
</blockquote>

<hr>

<p>You can use the <tt><font FACE="Courier">Vce</font></tt> control tag to program the TTS 
engine to carry on a multiperson dialog. </p>

<h3><a NAME="ThePhraseModificationControlTags">The Phrase Modification Control Tags</a></h3>

<p>The second set of control tags-the phrase modification tags-can be used to modify words 
or phrases within the message stream. Phrase modification tags give you added control over 
TTS output. There are five phrase modification control tags: 

<ul>
  <li><tt><font FACE="Courier">Emp</font></tt>-Used to add emphasis to a single word. </li>
  <li><tt><font FACE="Courier">Pau</font></tt>-Used to place a silent pause into the output 
    stream. </li>
  <li><tt><font FACE="Courier">Pit</font></tt>-Used to alter the base pitch of the output. </li>
  <li><tt><font FACE="Courier">Spd</font></tt>-Used to set the base speed of the output. </li>
  <li><tt><font FACE="Courier">Vol</font></tt>-Used to set the base volume of the output. </li>
</ul>

<h4>Using the <tt><font FACE="Courier">Emp</font></tt> Tag to Add Emphasis to a Word</h4>

<p>You can insert the <tt><font FACE="Courier">\Emp\</font></tt> tag before a word to 
force the TTS engine to give it added emphasis. Enter the text shown in Listing 18.4 and 
press <tt><font FACE="Courier">TextData</font></tt> to hear the results. </p>

<hr>

<blockquote>
  <b><p>Listing 18.4. Testing the <tt><font FACE="Courier">Emp</font></tt> control tag.<br>
  </b></p>
</blockquote>

<blockquote>
  <tt><font FACE="Courier"><p>I \Emp\told you never to go running in the street.<br>
  <br>
  Didn't you \Emp\hear me?<br>
  <br>
  You must listen to me when I tell you something \Emp\important.</font></tt> </p>
</blockquote>

<hr>

<p>You can quickly compare this phrase to one without emphasis by simply adding a space to 
each <tt><font FACE="Courier">\Emp\</font></tt> tag so that is looks like<tt><font
FACE="Courier"> \ Emp\</font></tt>. Since this will appear to be a new tag, the TTS engine 
will ignore it and speak the text with standard prosody. </p>

<h4>Using the <tt><font FACE="Courier">Pau</font></tt> Control Tag to Add Pauses to the 
Text</h4>

<p>You can use the <tt><font FACE="Courier">Pau</font></tt> tag to add pauses to the 
playback. The pause is measured in milliseconds. Here's an example of the <tt><font
FACE="Courier">Pau</font></tt> tag syntax: </p>

<blockquote>
  <tt><font FACE="Courier"><p>\Pau=1000\</font></tt> </p>
</blockquote>

<p>To test the <tt><font FACE="Courier">Pau</font></tt> tag, add two tags to the speech 
you entered from the previous example. Your text should now look like the text in Listing 
18.5. </p>

<hr>

<blockquote>
  <b><p>Listing 18.5. Testing the <tt><font FACE="Courier">Pau</font></tt> control tag.<br>
  </b></p>
</blockquote>

<blockquote>
  <tt><font FACE="Courier"><p>I \Emp\told you never to go running in the street.<br>
  \pau=1000\<br>
  Didn't you \Emp\hear me?<br>
  \pau=2000\<br>
  You must listen to me when I tell you something \Emp\important.</font></tt> </p>
</blockquote>

<hr>

<h4>Using the <tt><font FACE="Courier">Pit</font></tt> Control Tag to Modify the Pitch of 
the Voice</h4>

<p>The <tt><font FACE="Courier">Pit</font></tt> control tag can be used to modify the base 
pitch of the voice. This base pitch is used to set the normal speaking pitch level. The 
actual pitch hovers above and below this value as the TTS engine mimics human speech 
prosody. The pitch is measured in hertz. There is a minimum and maximum pitch: the minimum 
pitch is 50 hertz and the maximum is 400 hertz. </p>

<p>Listing 18.6 shows modifications to the previous text adding <tt><font FACE="Courier">\Pit\</font></tt> 
control tags to the text. </p>

<hr>

<blockquote>
  <b><p>Listing 18.6. Testing the <tt><font FACE="Courier">Pit</font></tt> control tag.<br>
  </b></p>
</blockquote>

<blockquote>
  <tt><font FACE="Courier"><p>\Pit=100\<br>
  I \Emp\told you never to go running in the street.<br>
  \pau=1000\ \Pit=200\<br>
  Didn't you \Emp\hear me?<br>
  \pau=2000\ \Pit=400\<br>
  You must listen to me when I tell you something \Emp\important. <br>
  \Pit=50\</font></tt> </p>
</blockquote>
<div align="center"><center>

<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
  <tr>
    <td><b>Tip</b></td>
  </tr>
  <tr>
    <td><blockquote>
      <p>Notice that the last line of Listing 18.6 shows a pitch tag setting the pitch back to 
      normal (<tt><font FACE="Courier">\Pit=50\</font></tt>). This is done because the pitch 
      setting does not automatically revert to the default level after a message has been 
      spoken. If you want to return the pitch to its original level, you must do so using the <tt><font
      FACE="Courier">Pit</font></tt> control tag. </p>
    </blockquote>
    </td>
  </tr>
</table>
</center></div>

<h4>Using the <tt><font FACE="Courier">Spd</font></tt> Control Tag to Modify the Playback 
Speed</h4>

<p>You can modify the playback speed of the TTS engine using the <tt><font FACE="Courier">\Spd\</font></tt> 
control tag. The speed is measured in words per minute (wpm). The minimum value is 50wpm 
and the maximum is 250wpm. Setting <tt><font FACE="Courier">Spd</font></tt> to 0 sets the 
slowest possible speed. Setting <tt><font FACE="Courier">Spd</font></tt> to -1 sets the 
fastest possible speed. Listing 18.7 shows additional modifications to the previous text. 
Enter this text and press the <tt><font FACE="Courier">TextData</font></tt> button to hear 
the results. </p>

<hr>

<blockquote>
  <b><p>Listing 18.7. Testing the <tt><font FACE="Courier">Spd</font></tt> control tag.<br>
  </b></p>
</blockquote>

<blockquote>
  <tt><font FACE="Courier"><p>\Spd=150\<br>
  I \Emp\told you never to go running in the street.<br>
  \pau=1000\ \Spd=75\<br>
  Didn't you \Emp\hear me?<br>
  \pau=2000\ \Spd=200\<br>
  You must listen to me when I tell you something \Emp\important. <br>
  \Spd=150\</font></tt> </p>
</blockquote>

<hr>

<h4>Using the <tt><font FACE="Courier">Vol</font></tt> Control Tag to Adjust Playback 
Volume</h4>

<p>The <tt><font FACE="Courier">Vol</font></tt> control tag can be used to adjust the base 
line volume of the TTS playback. The value can range from 0 (the quietest) to 65535 (the 
loudest). The actual pitch hovers above and below the value set by <tt><font
FACE="Courier">Vol</font></tt>. Make the changes to the text shown in Listing 18.8 and 
press <tt><font FACE="Courier">TextData</font></tt> to hear the results. </p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -