texttospeechsimpleu.pas

来自「sapi51的使用」· PAS 代码 · 共 36 行

PAS
36
字号
unit TextToSpeechSimpleU;

//Uses SAPI 5.1 early bound Automation

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ActnList, ComCtrls, Buttons, ImgList, ToolWin,
  OleServer, SpeechLib_TLB;

type
  TfrmTextToSpeech = class(TForm)
    memText: TMemo;
    Label7: TLabel;
    Button1: TButton;
    SpVoice1: TSpVoice;
    procedure Button1Click(Sender: TObject);
  end;

var
  frmTextToSpeech: TfrmTextToSpeech;

implementation

{$R *.dfm}

{ TfrmTextToSpeech }

procedure TfrmTextToSpeech.Button1Click(Sender: TObject);
begin
  SpVoice1.Speak(memText.Text, SVSFDefault)
end;

end.

⌨️ 快捷键说明

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