zoukankan      html  css  js  c++  java
  • 语音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

  • 相关阅读:
    20+ 个高质量的 Web 按钮设计 PSD 下载
    12 月份 10 个新鲜的 jQuery 插件和教程
    20+ 个有用的 Google 地图的 jQuery 插件和教程
    5个界面效果很炫的JavaScript UI框架
    分享50个使用非比寻常导航菜单设计的创20111227creati意网站
    8 款为 WordPress 文章生成缩略图的插件
    百万级访问量网站的技术准备工作
    推荐8个独特应用的JQuery拖放插件
    开源软件发展史【信息图】
    iOS应用开发应遵循的10条设计原则
  • 原文地址:https://www.cnblogs.com/CodeSkill/p/5851820.html
Copyright © 2011-2022 走看看