Aşağıdaki HTML kodunu TWebBrowser bileşeninize yükleyin..
Kod: Tümünü seç
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>
<textarea id="mesaj"></textarea>
<script src="https://code.responsivevoice.org/responsivevoice.js"></script>
<input id="Play" onclick="responsiveVoice.speak(document.getElementById('mesaj').value, 'Turkish Male');" type="button" value="Play" />
</body>
</html>
Kod: Tümünü seç
procedure TForm1.BTNSeslendirClick(Sender: TObject);
begin
WebBrowser1.OleObject.Document.GetElementByID('mesaj').Value :=
'Delphi Forum. Ağzının tadını bilenlerin Delphi forumu';
WebBrowser1.OleObject.Document.GetElementByID('Play').click();
end;