1. 程式人生 > >JSP頁面實現語音播報

JSP頁面實現語音播報

<%@ page language="java" import="java.util.*,javax.servlet.http.Cookie" pageEncoding="utf-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="overflow:hidden">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>語音播報</title>
		<script type="text/javascript">
		 	function test(){
	 			var ocx = document.getElementById("speakocx");
	 			var msg = "測試語音播放";
	 			ocx.Speak(msg,1);
		 	}
		</script>
	</head>

	<body>
		<OBJECT Name="SpeakMainCAB" id="speakocx" classid="" codebase="/web/SpeakMain.cab#version=1,0,7,0" width="0" height="0">
 		</OBJECT>

		<div>
   			<a onclick="test()">測試語音</a>
 		</div>
 	</body>
</html>