在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
windows自带语音接口 SAPI.SpVoice, 接口说明如下 https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ee125663(v%3dvs.85) 简单调用代码: uses System.Win.ComObj; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var lO: OleVariant; begin lO := CreateOleObject('SAPI.SpVoice'); {设置语音库 男/女 中文/英文支持, 这句可以不要, 使用默认语音库} lO.Voice := lO.GetVoices('name=Microsoft David Desktop', '').Item(0); {语音播报} lO.Speak(Memo1.Lines.Text); end; procedure TForm1.Button2Click(Sender: TObject); var lO, lV, lX: OleVariant; x: integer; begin {获取系统语音库} lO := CreateOleObject('SAPI.SpVoice'); lV := lO.GetVoices; for x := 0 to lV.count - 1 do begin lX := lV.item(x); memo1.Lines.Add(lX.GetDescription); end; end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论