1
我在Windows 7中創建了文本到語音的代碼並安裝了Microsoft Speech SDK。當我在Internet Explorer中打開此代碼時,沒有任何反應。在Internet Explorer中的文本到語音
<html>
<head>
</head>
<body>
<input type="text" name="textinput" size="30">
<script type="text/vbscript">
Sub SpeakIt
Dim msg, sapi
msg= textinput.Value
Set sapi=CreateObject("sapi.spvoice")
sapi.Speak msg
End Sub
</script>
<input type="button" value="speak" onClick="SpeakIt">
</body>
</html>
此代碼將使用安裝在用戶計算機上的桌面SR引擎,而不是顯然安裝的服務器SR引擎(Microsoft Speech SDK是服務器SR引擎)。你想在服務器端完成TTS嗎?然後你需要將腳本標記爲'runat = server'(我相信)。 –