uses Comobj;
procedure TForm1.Button1Click(Sender: TObject);
var
voice: OLEVariant;
begin
voice := CreateOLEObject('SAPI.SpVoice');
voice.Speak('Hello World!', 0);
end;
Delphi_TTS_1
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, Menus, OleCtrls, ACTIVEVOICEPROJECTLib_TLB; type TForm1 = class(TForm) MainMenu1: TMainMenu; Go1: TMenuItem; Alpha1: TMenuItem; N201: TMenuItem; N501: TMenuItem; N1001: TMenuItem; RT: TRichEdit; ss: TDirectSS; procedure RS(Sender: TObject); procedure N201Click(Sender: TObject); procedure N501Click(Sender: TObject); procedure N1001Click(Sender: TObject); procedure Go1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation { $R *.dfm} procedure TForm1.RS(Sender: TObject); begin rt.Width :=form1.Width -10; rt.Height :=form1.Height -48; end; procedure TForm1.N201Click(Sender: TObject); begin form1.AlphaBlendValue := 51; end; procedure TForm1.N501Click(Sender: TObject); begin form1.AlphaBlendValue := 130; end; procedure TForm1.N1001Click(Sender: TObject); begin form1.AlphaBlendValue := 255; end; procedure TForm1.Go1Click(Sender: TObject); begin ss.Speak(rt.Text); end; end.
SpeechLib_TLB控件效能
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
SpeechLib_TLB控件功能 我在Delphi编写的软件中用到SpeechLib_TLB,声音软件XPSpeech.msi,可以发出的声音不好听,而且声音很小,想请问是哪方面的原因,是XPSpeech.msi软件的原因吗?需要购买发声收费软件吗? ------解决方案-------------------------------------------------------- unit Ifly_Stts; interface implementation // 各种声音格式 Const TTS_ADF_DEFAULT = 0; TTS_ADF_PCM8K8B1C = 1; TTS_ADF_PCM16K8B1C = 2; TTS_ADF_PCM8K16B1C = 3; TTS_ADF_PCM16K16B1C = 4; TTS_ADF_PCM11K8B1C = 5; TTS_ADF_PCM11K16B1C = 6; TTS_ADF_ALAW16K1C = 9; TTS_ADF_ULAW16K1C = 10; TTS_ADF_ALAW8K1C = 11; TTS_ADF_ULAW8K1C = 12; TTS_ADF_ALAW11K1C = 13; TTS_ADF_ULAW11K1C