구글번역에서 소리를 제공하는 url를 이용하여 간단한 TTS 구현 예제
<HTML>
<HEAD>
<TITLE> 구글음성서비스 </TITLE>
<META name="Generator" content="EditPlus">
<META name="Author" content="">
<META name="Keywords" content="">
<META name="Description" content="">
<SCRIPT type="text/javascript">
<!--
function doVoice(){
var str = document.getElementById("txt").value;
var urlPar="http://translate.google.co.kr/translate_tts?ie=UTF-8&q="+encodeURI(str)+"&tl=ko&prev=input";
document.getElementById("bgs").src =urlPar;
document.getElementById("view").innerText=encodeURI(str);
}
//-->
</SCRIPT>
</HEAD>
<BODY>
한글을 입력해주세요<br>
<INPUT type="text" name="txt" id="txt">
<INPUT type="button" value="음성듣기" onclick="javascript
<div id="view"></div>
<bgsound id="bgs">
</BODY>
</HTML>