亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? speech synthesis & speech recognition using sapi 5_1.htm

?? softonline.dll中函數的使用,請見不同的例程,VB函數見VB例子,VC函數見VC例子,VFP函數見VFP的例子,BCB函數見BCB例子, Delphi函數見Delphi例子
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0066)http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm -->
<HTML><HEAD><TITLE>Speech Synthesis & Speech Recognition Using SAPI 5.1</TITLE>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR></HEAD>
<BODY bgColor=lightblue><A name=Top></A><FONT 
face="Verdana, Arial, Helvetica, sans-serif" size=2><IMG align=right alt=Athena 
height=164 
src="Speech Synthesis &amp; Speech Recognition Using SAPI 5_1.files/Athena.gif" 
width=174> 
<H1>
<P align=center>Speech Synthesis &amp; Speech Recognition Using SAPI 
5.1</P></H1>
<P align=center><A 
href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#AboutBrian"><I>Brian 
Long</I></A> (<A href="http://www.blong.com/" 
target=_blank>http://www.blong.com/</A>)</P>
<H2>Table of Contents</H2>
<UL>
  <LI><A 
  href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#Introduction">Introduction</A> 

  <LI><A 
  href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#TTS">Speech 
  Synthesis</A> 
  <UL>
    <LI><A 
    href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#EnumVoices">Enumerating 
    Voices</A> 
    <LI><A 
    href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#Speech">Making 
    Your Computer Talk</A> 
    <LI><A 
    href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#Events">Voice 
    Events</A> 
    <LI><A 
    href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#Animation">Animating 
    Speech</A> 
    <LI><A 
    href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#KeepingTrack">Keeping 
    Track Of Spoken Text</A> 
    <LI><A 
    href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#SpeakingDialogs">Speaking 
    Dialogs</A> </LI></UL>
  <LI><A 
  href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#SR">Speech 
  Recognition</A> 
  <UL>
    <LI><A 
    href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#Grammars">Grammars</A> 

    <LI><A 
    href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#DSR">Continuous 
    Dictation Recognition</A> 
    <UL>
      <LI><A 
      href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#GramNotify">Grammar 
      Notifications</A> 
      <LI><A 
      href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#EngineDialogs">Engine 
      Dialogs</A> </LI></UL>
    <LI><A 
    href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#CnC">Command 
    and Control Recognition</A> 
    <LI><A 
    href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#Troubleshooting">Speech 
    Recognition Troubleshooting</A> </LI></UL>
  <LI><A 
  href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#Deployment">SAPI 
  5.1 Deployment</A> 
  <LI><A 
  href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#Summary">Summary</A> 

  <LI><A 
  href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#References">References/Further 
  Reading</A> 
  <LI><A 
  href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm#AboutBrian">About 
  Brian Long</A> </LI></UL>
<P><A 
href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.zip">Click 
here</A> to download the files associated with this article.</P>
<HR>

<H2><A name=Introduction>Introduction</A></H2>
<P>This article looks at adding support for speech capabilities to Microsoft 
Windows applications written in Delphi, using the Microsoft Speech API version 
5.1 (SAPI 5.1). For an overview on the subject of speech technology please <A 
href="http://www.blong.com/Conferences/DCon2002/Speech/Speech.htm">click 
here</A>.</P>
<P>There is also coverage on using SAPI 4 to build speech-enabled applications. 
Information on using the SAPI 4 high level interfaces can be found by <A 
href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI4HighLevel/SAPI4.htm">clicking 
here</A>, whilst discussion of the low level interfaces can be found by <A 
href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI4LowLevel/SAPI4.htm">clicking 
here</A>.</P>
<P>SAPI 5.1 exposes most of the important interfaces, types and constants 
through a registered type library (SAPI 5.0 did not do this, making it difficult 
to use in Delphi without someone writing the equivalent of the JEDI import unit 
for SAPI 5). This means that you can access SAPI 5.1 functionality through late 
bound or early bound Automation. We will focus our attention on early bound 
Automation, which requires you to import the type library.</P>
<P>Choose <FONT face="Courier New, Courier, mono">Project | Import Type 
Library...</FONT> and locate the type library described as <I>Microsoft Speech 
Object Library (Version 5.1)</I> in the list. Now ensure the <FONT 
face="Courier New, Courier, mono">Generate Component Wrapper</FONT> checkbox is 
checked so the type library import unit will include component wrapper classes 
for each exposed Automation object. These components will go on the 
<I>ActiveX</I> page of the Component Palette by default, but you may wish to 
specify a more appropriate page, such as <I>SAPI 5.1</I>.</P>
<P>Now press <FONT face="Courier New, Courier, mono">Install...</FONT> so the 
type library will be imported and the generated components will be installed 
onto the Component Palette (pressing <FONT 
face="Courier New, Courier, mono">Create Unit</FONT> would also generate the 
type library import unit, but would require us to install it manually).</P>
<P>The generated import unit is called SpeechLib_TLB.pas and will be installed 
in a package. You can either select the default package offered (the <I>Borland 
User Components</I> package by default), choose to open a different package or 
even create a new one. When the package is compiled and installed you will get a 
whopping set of 19 new components on the <I>SAPI 5.1</I> page of the Component 
Palette.</P>
<P>Each component is named after the primary interface it implements. So for 
example, the <FONT face="Courier New, Courier, mono">TSpVoice</FONT> component 
implements the <FONT face="Courier New, Courier, mono">SpVoice</FONT> interface. 
You can find abundant documentation on all these interfaces in the SAPI 5.1 SDK 
documentation.</P>
<P>Ready made SAPI 5.1 packages containing Automation components for Delphi 5, 6 
and 7 can be found in appropriately named subdirectories under SAPI 5.1 in the 
accompanying files.</P>
<P><B><U>Note:</U></B> if you are using Delphi 6 you will encounter a problem 
that is still present even with Update Pack 2 installed. The type library 
importer has a bug where the parameters to Automation events are incorrectly 
dispatched (they are sent in reverse order) meaning that all the Automation 
events operate incorrectly (if at all). You can avoid this by importing the type 
library in Delphi 5 or 7 and using the generated type library import unit in 
Delphi 6. A Delphi 6 compatible package is supplied with <A 
href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.zip">this 
article's files</A> (it uses a Delphi 5 generated type library import unit).</P>
<P><B><U>Note:</U></B> The Delphi 7 type library importer has been improved to 
produce more accurate Pascal representations of items in the type library than 
Delphi 5 did (and than Delphi 6 tried to). As a result of this, the event 
handlers will often have different parameter lists in the Delphi 7 imported type 
library. This means that the sample programs won't compile with Delphi 7 with 
the true Delphi 7 SAPI type library import unit.</P>
<P>If you wish, you can write late bound Automation that calls <FONT 
face="Courier New, Courier, mono">CreateOleObject</FONT> to instantiate the 
Automation objects. In the case of the <FONT 
face="Courier New, Courier, mono">SpVoice</FONT> interface, you would 
execute:</P>
<TABLE bgColor=white border=1>
  <TBODY>
  <TR>
    <TD><PRE><CODE><FONT color=black size=2>
<B>var</B>
  SpVoice: Variant;
...
SpVoice := CreateOleObject(<I>'SAPI.SpVoice'</I>)
</FONT></CODE></PRE></TD></TR></TBODY></TABLE>
<H2><A name=TTS>Speech Synthesis</A></H2>
<P>At its simplest level, all you need to do to get your program to speak is to 
use a <FONT face="Courier New, Courier, mono">TSpVoice</FONT> Automation object 
and call the <FONT face="Courier New, Courier, mono">Speak</FONT> method. A 
trivial application that does this can be found in the TextToSpeechSimple.dpr 
project in <A 
href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.zip">the 
files associated with this article</A>. The code looks like this:</P>
<TABLE bgColor=white border=1>
  <TBODY>
  <TR>
    <TD><PRE><CODE><FONT color=black size=2>
<B>procedure</B> TfrmTextToSpeech.Button1Click(Sender: TObject);
<B>begin</B>
  SpVoice1.Speak(memText.Text, SVSFDefault)
<B>end</B>;
</FONT></CODE></PRE></TD></TR></TBODY></TABLE>
<P>And there you have it: a speaking application. The call to Speak takes a 
number of parameters that we should examine:</P>
<UL>
  <LI>The first is the text to speak, passed as a <FONT 
  face="Courier New, Courier, mono">PChar</FONT>. Because of the second 
  parameter, this call will be synchronous and so will not return until the text 
  has been spoken. 
  <LI>The second parameter represents some flags that indicate how to use the 
  first parameter (you can combine multiple flags with the <FONT 
  face="Courier New, Courier, mono">or</FONT> operator). For example:<BR>
  <UL>
    <LI><FONT face="Courier New, Courier, mono">SVSFDefault</FONT> means the 
    <FONT face="Courier New, Courier, mono">Speak</FONT> method will be 
    synchronous 
    <LI><FONT face="Courier New, Courier, mono">SVSFlagAsync</FONT> makes the 
    <FONT face="Courier New, Courier, mono">Speak</FONT> method asynchronous and 
    so it returns immediately (you can use events to find out when speech 
    terminates, or call the <FONT 
    face="Courier New, Courier, mono">WaitUntilDone</FONT> method, or call <FONT 
    face="Courier New, Courier, mono">SpeakCompleteEvent</FONT> to receive a 
    Win32 event handle, which can be passed to <FONT 
    face="Courier New, Courier, mono">WaitForSingleObject</FONT>).<BR>Note that 
    the <FONT face="Courier New, Courier, mono">Speak</FONT> method returns a 
    stream number. When queuing several asynchronous voice streams, the stream 
    number allows you to identify them; each voice event passes the stream 
    number to which it relates as a parameter. 
    <LI><FONT face="Courier New, Courier, mono">SVSFPurgeBeforeSpeak</FONT> 
    means any text being spoken and any text queued to speak will be immediately 
    cancelled. 
    <LI><FONT face="Courier New, Courier, mono">SVSFNLPSpeakPunc</FONT> means 
    punctuation marks are read out by their names, rather than being used as 
    punctuation (so ? is read out as <I>question mark</I>) 
    <LI><FONT face="Courier New, Courier, mono">SVSFIsFilename</FONT> means the 
    first parameter is a file name containing text to speak. 
    <LI>SVSFIsXML means the text includes XML tags to alter attributes of the 
    spoken text. For example this text controls the pitch, rate, volume, 
    emphasis and pronunciation of the spoken text:<BR>
    <TABLE bgColor=white border=1>
      <TBODY>
      <TR>
        <TD><PRE><CODE><FONT color=black size=2>
&lt;EMPH&gt;Hello&lt;/EMPH&gt;
&lt;PRON SYM="d eh l f y"&gt;Delphi&lt;/PRON&gt; developers!
&lt;VOLUME LEVEL="70"&gt;
I can speak &lt;PITCH MIDDLE="+10"&gt;high&lt;/PITCH&gt; and &lt;PITCH MIDDLE="-10"&gt;low&lt;/PITCH&gt;.
I can speak &lt;RATE SPEED="+10"&gt;very quickly&lt;/RATE&gt; and &lt;RATE SPEED="-10"&gt;very slowly&lt;/RATE&gt;.
I can speak &lt;VOLUME LEVEL="40"&gt;quietly&lt;/VOLUME&gt; and &lt;VOLUME LEVEL="100"&gt;loudly&lt;/VOLUME&gt;.
&lt;/VOLUME&gt;
</FONT></CODE></PRE></TD></TR></TBODY></TABLE></LI></UL></LI></UL>
<P>When the program executes it lets you type in some text in a memo and a 
button renders it into the spoken word.</P>
<P align=center><IMG 
src="Speech Synthesis &amp; Speech Recognition Using SAPI 5_1.files/TextToSpeechSimple.png"></P>
<P>That's the simple example out of the way, but what can we achieve if we dig a 
little deeper and get our hands a little dirtier? The next project, which holds 
the answers to these questions, can be found as TextToSpeech.dpr in <A 
href="http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.zip">this 
article's files</A>. You can see it running in the screenshot below; notice that 
as the text is spoken, the current sentence is italicised and the current word 
is displayed selected and also the phonemes spoken are written to a memo.</P>
<P align=center><IMG 
src="Speech Synthesis &amp; Speech Recognition Using SAPI 5_1.files/TextToSpeech.png"></P>
<P>The following sections describe the important parts of the code from this 
project.</P>
<H3><A name=EnumVoices>Enumerating Voices</A></H3>
<P>The first thing the program does is to add a list of all the available voices 
to the combobox and set the rate and volume track bar positions. The latter part 
of this is trivial as the voice rate and volume are always within predetermined 
ranges (the volume is in the range 0 to 100 and the rate is in the range -10 to 
10).</P>
<TABLE bgColor=white border=1>
  <TBODY>
  <TR>
    <TD><PRE><CODE><FONT color=black size=2>
<B>procedure</B> TfrmTextToSpeech.FormCreate(Sender: TObject);
<B>var</B>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品一区二区三区免费视频| 韩国v欧美v亚洲v日本v| 五月婷婷综合激情| 国产精品91xxx| 欧美日韩精品三区| 国产精品污网站| 日韩av电影天堂| 色噜噜久久综合| 国产片一区二区| 日本视频一区二区| 色视频一区二区| 国产精品污网站| 国产福利91精品一区| 日韩欧美国产系列| 亚洲成人午夜电影| 色网综合在线观看| 国产欧美va欧美不卡在线| 日本欧美在线看| 欧美色网站导航| 亚洲日本va在线观看| 国产成人免费在线视频| 精品欧美久久久| 日本欧美在线看| 91精品国产综合久久福利| 亚洲综合久久久久| 色婷婷综合在线| 日韩理论片网站| www.色综合.com| 国产精品女同一区二区三区| 国产乱码一区二区三区| 欧美mv和日韩mv国产网站| 美日韩一区二区三区| 日韩欧美一二三四区| 奇米四色…亚洲| 日韩一区二区三区在线| 午夜激情久久久| 欧美一级高清片| 免费成人性网站| 2021中文字幕一区亚洲| 国产伦精品一区二区三区免费迷| 日韩三级电影网址| 激情五月播播久久久精品| 欧美一二三四在线| 狠狠网亚洲精品| 久久久不卡网国产精品一区| 国产精品资源在线观看| 亚洲国产成人午夜在线一区| 成人开心网精品视频| 亚洲欧洲日韩女同| 欧美午夜在线观看| 日韩高清不卡一区二区| 精品免费视频一区二区| 国产福利一区二区三区视频在线 | 久久嫩草精品久久久精品| 日韩**一区毛片| 久久久久久久国产精品影院| 成人av在线资源网站| 一区二区三区四区蜜桃| 欧美一区二区精品| 东方aⅴ免费观看久久av| 亚洲免费视频成人| 91精品国产免费| 粉嫩aⅴ一区二区三区四区五区| 国产欧美精品一区二区色综合朱莉| k8久久久一区二区三区| 日韩不卡一区二区三区| 日本一区二区成人| 精品视频免费看| 国产剧情一区在线| 亚洲制服丝袜av| 26uuu色噜噜精品一区二区| 成人夜色视频网站在线观看| 午夜一区二区三区在线观看| 久久久国产一区二区三区四区小说| 一本一道波多野结衣一区二区| 免费观看成人鲁鲁鲁鲁鲁视频| 国产精品免费久久久久| 91精品国产黑色紧身裤美女| 成人午夜视频福利| 免费一级片91| 亚洲精品国产无套在线观| 精品国产99国产精品| 欧美性猛片xxxx免费看久爱| 国产成人亚洲精品狼色在线| 天天av天天翘天天综合网色鬼国产| 国产欧美视频在线观看| 9191精品国产综合久久久久久| 成a人片国产精品| 久久成人精品无人区| 亚洲成人免费av| 亚洲欧美日韩中文字幕一区二区三区 | 亚洲日本护士毛茸茸| 精品精品国产高清一毛片一天堂| 欧美性色黄大片| 99久久99久久精品国产片果冻| 狠狠久久亚洲欧美| 男女男精品视频网| 午夜av一区二区| 亚洲激情第一区| 亚洲欧美综合另类在线卡通| 国产日本一区二区| 久久亚洲综合av| 欧美一区二区视频网站| 欧美蜜桃一区二区三区| 欧美调教femdomvk| 欧美天堂一区二区三区| 色综合久久久久综合体| 成人av电影在线播放| 成人免费视频网站在线观看| 国产精品一区二区三区四区| 国产麻豆9l精品三级站| 国产精品一区二区视频| 国产精品自拍网站| 国产盗摄一区二区| 国产精品主播直播| 成人美女视频在线观看| 99久久国产综合精品麻豆| 91免费国产在线| 91福利精品视频| 欧美午夜免费电影| 欧美电影影音先锋| 日韩精品中文字幕一区二区三区 | 97精品久久久久中文字幕| 成人国产精品免费| 高清国产一区二区| 99亚偷拍自图区亚洲| 91婷婷韩国欧美一区二区| 99久久精品免费看国产| 色美美综合视频| 精品视频全国免费看| 日韩一区二区电影| 国产视频一区在线播放| 国产精品区一区二区三| 亚洲视频一区二区在线| 午夜国产不卡在线观看视频| 久久精品国产色蜜蜜麻豆| 国产精品一区二区三区乱码| av在线综合网| 欧美三级视频在线| 欧美成人三级在线| 亚洲国产精品传媒在线观看| 亚洲欧美电影院| 秋霞成人午夜伦在线观看| 国产酒店精品激情| 欧美亚洲精品一区| 日韩精品在线一区二区| 中文字幕乱码亚洲精品一区| 亚洲一二三四在线观看| 九色综合狠狠综合久久| av成人免费在线观看| 欧美美女直播网站| 国产欧美一区二区三区鸳鸯浴| 亚洲男人电影天堂| 久久精品72免费观看| 成人aaaa免费全部观看| 制服丝袜亚洲色图| 国产精品第13页| 青青草97国产精品免费观看 | 亚洲视频一区二区免费在线观看| 亚洲国产精品久久人人爱蜜臀| 国内久久婷婷综合| 欧美无砖专区一中文字| 久久久精品影视| 亚洲国产一二三| 不卡电影免费在线播放一区| 91精选在线观看| 亚洲六月丁香色婷婷综合久久| 激情久久久久久久久久久久久久久久| 97久久超碰国产精品| 久久九九影视网| 久热成人在线视频| 欧美精品日韩一区| 亚洲欧美偷拍三级| 国产99久久久精品| 日韩欧美一级二级三级 | 中文字幕视频一区二区三区久| 视频一区中文字幕| 色琪琪一区二区三区亚洲区| 国产调教视频一区| 精品午夜一区二区三区在线观看| 欧美在线啊v一区| 国产精品福利在线播放| 国产在线视频精品一区| 日韩一区二区三区视频在线| 一区二区三区在线免费| 99久久综合色| 亚洲国产精品99久久久久久久久| 免费看日韩a级影片| 91精品免费在线观看| 一区二区三区四区av| 99精品视频一区二区| 国产精品三级av| 国产91丝袜在线播放| 久久一留热品黄| 国产一区二区三区在线观看免费视频 | 偷拍一区二区三区| 欧美区在线观看| 日日夜夜一区二区| 欧美精品日日鲁夜夜添| 亚洲成人资源网|