<!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 & Speech Recognition Using SAPI 5_1.files/Athena.gif"
width=174>
<H1>
<P align=center>Speech Synthesis & 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 i
语音开发英文资料(TTS使用指南Delphi版)
5星 · 超过95%的资源 需积分: 50 143 浏览量
2004-11-08
05:55:00
上传
评论 1
收藏 256KB RAR 举报
microrain
- 粉丝: 1015
- 资源: 598
最新资源
- 基于ThinkPHP的轻量级PHP开发框架设计源码
- 基于CSS的响应式鲜花网站全屏效果设计源码
- 基于JavaScript的访客预约系统设计源码
- 基于Vue和ECharts的工作租房数据可视化系统设计源码
- 1040g0cg310ravpiu6ibg5pg00tsipsln3ju2d0g 2
- 基于Python的SAR图像去噪CNN-NLM设计源码
- redhat6升级到redhat7,过程redhat6.x-> redhat6.10->rehat7.9 主版本最高版本
- 基于Django的流程引擎设计源码
- 基于Node.js的Express框架与MySQL的后台管理系统设计源码
- 基于Java的Flink流批一体数据处理快速集成开发框架设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈