本文整理自网络,侵删。
var Stream : TMemoryStream;begin Stream := TMemoryStream.Create;
try // idHTTPUserAgent IdHTTP1.Request.UserAgent := 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401'; IdHTTP1.Get(TIdURI.URLEncode('http://translate.google.com/translate_tts?tl=ko&q=' + txtHangul.Text), Stream); finally MediaPlayer1.Close; Stream.SaveToFile(ExtractFilePath(Application.ExeName) + 'temp.mp3');
MediaPlayer1.FileName := ExtractFilePath(Application.ExeName) + 'temp.mp3'; MediaPlayer1.Open; MediaPlayer1.Play; end;end;
相关阅读 >>
incyear:将一个tdatetime变量加减一定数量的年数
Delphi tnotification android通知
Delphi webbrowser多次执行documentcomplete
更多相关阅读请进入《Delphi》频道 >>