⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vtxtauto_tlb.pas

📁 关于tts语音引擎的使用方法!很多软件具有英文发音和朗读功能
💻 PAS
字号:
unit VTxtAuto_TLB;

interface

uses ActiveX, Classes, Graphics, OleServer, StdVCL, Variants, Windows;
  
// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:        
//   Type Libraries     : LIBID_xxxx                                      
//   CoClasses          : CLASS_xxxx                                      
//   DISPInterfaces     : DIID_xxxx                                       
//   Non-DISP interfaces: IID_xxxx                                        
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  VTxtAutoMajorVersion = 1;
  VTxtAutoMinorVersion = 0;

  LIBID_VTxtAuto: TGUID = '{FF2C7A51-78F9-11CE-B762-00AA004CD65C}';

  IID_IVTxtAuto: TGUID = '{FF2C7A50-78F9-11CE-B762-00AA004CD65C}';
  CLASS_VTxtAuto_: TGUID = '{FF2C7A52-78F9-11CE-B762-00AA004CD65C}';

// *********************************************************************//
// Declaration of Enumerations defined in Type Library                    
// *********************************************************************//
// Constants for enum SPEAKFLAGS
type
  SPEAKFLAGS = TOleEnum;
const
  vtxtst_STATEMENT = $00000001;
  vtxtst_QUESTION = $00000002;
  vtxtst_COMMAND = $00000004;
  vtxtst_WARNING = $00000008;
  vtxtst_READING = $00000010;
  vtxtst_NUMBERS = $00000020;
  vtxtst_SPREADSHEET = $00000040;
  vtxtsp_VERYHIGH = $00000080;
  vtxtsp_HIGH = $00000100;
  vtxtsp_NORMAL = $00000200;

type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary                    
// *********************************************************************//
  IVTxtAuto = interface;
  IVTxtAutoDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library                       
// (NOTE: Here we map each CoClass to its Default Interface)              
// *********************************************************************//
  VTxtAuto_ = IVTxtAuto;


// *********************************************************************//
// Interface: IVTxtAuto
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {FF2C7A50-78F9-11CE-B762-00AA004CD65C}
// *********************************************************************//
  IVTxtAuto = interface(IDispatch)
    ['{FF2C7A50-78F9-11CE-B762-00AA004CD65C}']
    procedure Register(const pszSite: WideString; const pszApp: WideString); safecall;
    procedure Speak(const pszBuffer: WideString; dwFlags: Integer); safecall;
    procedure StopSpeaking; safecall;
    procedure AudioPause; safecall;
    procedure AudioResume; safecall;
    procedure AudioRewind; safecall; //跳到上一句 
    procedure AudioFastForward; safecall; //跳到下一句
    procedure Set_Callback(const Param1: WideString); safecall;
    procedure Set_Speed(pdwSpeed: Integer); safecall;
    function  Get_Speed: Integer; safecall;
    procedure Set_Enabled(pdwEnabled: Integer); safecall;
    function  Get_Enabled: Integer; safecall;
    function  Get_IsSpeaking: WordBool; safecall;
    property Speed: Integer write Set_Speed;
    property Enabled: Integer write Set_Enabled;
    property IsSpeaking: WordBool read Get_IsSpeaking;
  end;

// *********************************************************************//
// DispIntf:  IVTxtAutoDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {FF2C7A50-78F9-11CE-B762-00AA004CD65C}
// *********************************************************************//
  IVTxtAutoDisp = dispinterface
    ['{FF2C7A50-78F9-11CE-B762-00AA004CD65C}']
    procedure Register(const pszSite: WideString; const pszApp: WideString); dispid 1610743808;
    procedure Speak(const pszBuffer: WideString; dwFlags: Integer); dispid 1610743809;
    procedure StopSpeaking; dispid 1610743810;
    procedure AudioPause; dispid 1610743811;
    procedure AudioResume; dispid 1610743812;
    procedure AudioRewind; dispid 1610743813;
    procedure AudioFastForward; dispid 1610743814;
    property Callback: WideString writeonly dispid 1610743815;
    property Speed: Integer writeonly dispid 1610743816;
    property Enabled: Integer writeonly dispid 1610743818;
    property IsSpeaking: WordBool readonly dispid 1610743820;
  end;

// *********************************************************************//
// The Class CoVTxtAuto_ provides a Create and CreateRemote method to          
// create instances of the default interface IVTxtAuto exposed by              
// the CoClass VTxtAuto_. The functions are intended to be used by             
// clients wishing to automate the CoClass objects exposed by the         
// server of this typelibrary.                                            
// *********************************************************************//
  CoVTxtAuto_ = class
    class function Create: IVTxtAuto;
    class function CreateRemote(const MachineName: string): IVTxtAuto;
  end;

implementation

uses ComObj;

class function CoVTxtAuto_.Create: IVTxtAuto;
begin
  Result := CreateComObject(CLASS_VTxtAuto_) as IVTxtAuto;
end;

class function CoVTxtAuto_.CreateRemote(const MachineName: string): IVTxtAuto;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_VTxtAuto_) as IVTxtAuto;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -