ネタキリラボ
ネタキリラボ[ラボ]

英語音声合成サンプル

準備

サンプルソース

音声合成は非常に簡単に使えます。音声認識を使っていて、認識が成功したとき声で返したりすると画面を見なくても操作ができるようになります。

フォーム

サンプルフォーム

ソース

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, SpeechLib_TLB, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private 宣言 }
    Voice: TSpVoice;
  public
    { Public 宣言 }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  //音声合成オブジェクトの作成
  Voice := TSpVoice.Create(Self);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Voice.Speak(Edit1.Text, SVSFDefault);
end;

end.

ダウンロード

[ Down ]


Copyright 2003-2010 yhira All Rights Reserved`
[Server] [Delphi Tips]
最終更新:2009/09/23 00:40:46