• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

语音02_Delphi

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

网址 :http://www.exceletel.com/support/whtpapers/speech/delphi.htm

 

 

Installing the Microsoft SAPI speech SDK in Delphi

After you install the SAPI 5.1 SDK available from Microsoft by clicking HERE, you will find that it gives you most of the important methods, events, types and constants through a registered type library.  This means that you can access SAPI 5.1 functionality through late bound or early bound Automation. 

From the Delphi menu select "Project | Import Type Library" and select "Microsoft Speech Object Library (Version 5.1) from the list of type libraries.

Check the "Generate Component Wrapper" checkbox.  This will give you component wrapper classes for the Automation objects listed in the file.  Create a new page called "SAPI 5.1" so that the created components will go on their own Component Palette.

Click on the Install button to automatically import the library and place the components on your SAPI 5.1 palette.

You will now have a file called SpeechLib_TLB.pas that you can reference to see all the classes and definitions which will be of help when you need to see how to convert types or see how a function is implemented.  You can create a new package for the resulting new components or use the default, "Borland User Components".


Here is the Install dialog showing the default.  You can click on the "into new package" tab and insert your own filename if you like.

Next click on the "Component | Install Packages" menu item and you will see the dialog box to the right.  Find your package, in this case the default where we added the SAPI 5.1 components to the Borland User Components Package.  Make sure your package is checked and press the "OK" button.


When you are done, you will see 19 new components on your SAPI 5.1 palette page!  Each of these components makes it easy to drop on your forms and access the interface associate with it.  You will see the TSpVoice component which we use in the sample programs to do the speaking with SpVoice events, methods and properties.  There are also the SpMMAudioOut component that lets us link a speech stream to a windows audio output device and SpAudioFormat which lets us control wave formats.  They don't seem to come with unique icons, which makes it hard to tell them apart from each other without getting hover help or memorizing their position in the list, but it sure is nice to have them componentized.

If you look in the Delphi 5, 6 and 7 folders under SAPI 5.1 you will find the component packages for each of these versions.  NOTE:  Delphi 6 had a bug that causes it to not to be able to import the type library properly, so you will have to create it in another version of Delphi and copy it in yourself.

Back to speech page...

 

X


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
matlab中mex文件(转)发布时间:2022-07-18
下一篇:
matlab中ischar确定输入是否为字符数组发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap