语音02_Delphi

Posted CodeSkill

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了语音02_Delphi相关的知识,希望对你有一定的参考价值。

网址 :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

以上是关于语音02_Delphi的主要内容,如果未能解决你的问题,请参考以下文章

分答出事了,是意味语音问答在我国走不下去了吗?

一站式打造你的智能语音产品欧拉蜜麦克风阵列板登陆众筹

转载:JavaScript文字转语音_SpeechSynthesisUtterance语音合成的使用

python 计算器语音播报模拟

006_STM32程序移植之_SYN6288语音模块

第六十九篇OC_录制语音和播放语音功能的实现