谁用过MS的TTS5.1,在delphi中的AxtiveX类为:TDirectSR,TDirectSS,TTexttoSpeech,安装了中文,却仍发英文.参数也不会调.谁用过的指点一下..

gum 2002-03-31 10:47:00
谁用过MS的TTS5.1,在delphi中的AxtiveX类为:TDirectSR,TDirectSS,TTexttoSpeech,安装了中文,却仍发英文.参数也不会调.谁用过的指点一下...
...全文
61 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cynwhm 2002-09-16
  • 打赏
  • 举报
回复
我已安装了MS SAPI5.1 中为何找不到SpeechLib_TLB文件。
smilboy 2002-06-13
  • 打赏
  • 举报
回复
请看
unit frm_VoiceMain;

interface

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

type
TfrmVoices = class(TForm)
SpVoice1: TSpVoice;
Button1: TButton;
cmbVoices: TComboBox;
memText: TMemo;
Button2: TButton;
tbRate: TTrackBar;
tbVolume: TTrackBar;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button3: TButton;
Button4: TButton;
Label4: TLabel;
cmbAudioOutput: TComboBox;
Button5: TButton;
procedure Button1Click(Sender: TObject);
procedure cmbVoicesChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure tbRateChange(Sender: TObject);
procedure tbVolumeChange(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure cmbAudioOutputChange(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
procedure InitVoices; //获取系统安装的语音库
procedure InitAudioOutputs; //获取系统声音输出设备
public
{ Public declarations }
end;

var
frmVoices: TfrmVoices;

implementation

{$R *.DFM}

procedure TfrmVoices.Button1Click(Sender: TObject);
begin
SpVoice1.Speak(memText.text,1);
end;

procedure TfrmVoices.cmbVoicesChange(Sender: TObject);
var
a,b:WideString;
begin
SpVoice1.Voice:=SpVoice1.GetVoices(a,b).item(cmbVoices.ItemIndex)
end;

procedure TfrmVoices.InitVoices;
var
a,b:WideString;
Voices:ISpeechObjectTokens;
i:integer;
begin
Voices:=SpVoice1.GetVoices(a,b);
for i:=0 to Voices.Count-1 do begin
cmbVoices.Items.Add(Voices.item(i).GetDescription(i))
end;
cmbVoices.ItemIndex:=0;
end;

procedure TfrmVoices.FormCreate(Sender: TObject);
begin
InitVoices;
InitAudioOutputs;
tbRate.Position:=SpVoice1.Rate;
tbVolume.Position:=SpVoice1.Volume;
end;

procedure TfrmVoices.tbRateChange(Sender: TObject);
begin
SpVoice1.Rate :=tbRate.Position;
end;

procedure TfrmVoices.tbVolumeChange(Sender: TObject);
begin
SpVoice1.Volume := tbVolume.Position;
end;

procedure TfrmVoices.Button3Click(Sender: TObject);
begin
SpVoice1.Pause
end;

procedure TfrmVoices.Button4Click(Sender: TObject);
begin
SpVoice1.Resume
end;

procedure TfrmVoices.InitAudioOutputs;
var
a,b:WideString;
AudioOutputs:ISpeechObjectTokens;
i:integer;
begin
AudioOutputs:=SpVoice1.GetAudioOutputs(a,b);
for i:=0 to AudioOutputs.Count-1 do begin
cmbAudioOutput.Items.Add(AudioOutputs.item(i).GetDescription(i))
end;
cmbAudioOutput.ItemIndex:=0;
end;

procedure TfrmVoices.cmbAudioOutputChange(Sender: TObject);
var
a,b:WideString;
begin
SpVoice1.AudioOutput:=SpVoice1.GetAudioOutputs(a,b).item(cmbAudioOutput.ItemIndex)
end;

procedure TfrmVoices.Button5Click(Sender: TObject);
var
WaveFileStream:SpFileStream;
SpFileMode:SpeechStreamFileMode;
begin
SpFileMode := SpeechStreamFileMode.SSFMCreateForWrite;
WaveFileStream.Open('c:\1.wav',SpFileMode,false);
SpVoice1.AudioOutputStream:= WaveFileStream;
SpVoice1.Speak(memtext.text,1);
SpVoice1.WaitUntilDone(1000);
WaveFileStream.Close;
end;

end.

src="DownloadFilesother_activeximagesamtitle.jpg" width="320" height="38">

你是否为无数次地安装/卸载ActiveX控件而烦恼?你还在用REGSVR32命令来安装/卸载ActiveX控件吗?那就试试强大的AxtiveX Manager!

ActiveX Manager 使程序开发者和普通用户管理/安装/卸载机器上的ActiveX控件变的轻而易举,简单友好的使用界面让你直观地管理电脑上已经安装/注册的所有ActiveX控件,你可以轻松注册/安装新控件、卸载不用的控件、对控件进行管理等。对于那些经常上网下载安装程序,又希望电脑系统保证干净的网迷来说,AxtiveX Manager更为有利(ActiveX Manager 可通过IE来清除不需要的控件)。

ActiveX Manager的程序界面如下:

src=DownloadFilesother_activeximagesactivex_manager.gif border="0"> 程序主界面

ActiveX Manager的关键特色: 使程序开发者和普通用户管理/安装/卸载机器上的ActiveX控件变的轻而易举; 让你直观地管理电脑上已经安装/注册的所有ActiveX控件,你可以轻松注册/安装新控件、卸载不用的控件、对控件进行管理; ActiveX Manager能够显示已注册的所有控件的相关属性,比如:控件版本、文件大小、日期等,方便你跟踪管理所有的控件; ActiveX Manager不仅方便你管理/安装/卸载机器上的ActiveX控件,而且还能够清理Windows注册表,保证你的系统干净安全; 生成控件报表的功能帮助管理员或开发人员最终能够为已安装的控件创建数据库报表。 对于系统管理员员和程序员,无数次地用REGSVR32命令安装/卸载ActiveX控件并不是愉快的事,AxtiveX Manager让控件的管理变得如此简单! ActiveX Manager 的下载:

828

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧