|
Call Text-to-Speech
Note: to use "Text-to-Speech", domain validation must be enabled within your account.
-
When the API is loaded, using the API loaded callback:
function vw_apiLoaded()
{
//the API is loaded, add actions here
sayText('Hello world',3,1,3);
sayText('...Hallo Welt...',1,3,2);
sayText('...Bonjour tout le monde...',1,4,2);
sayText('こんにちは世界',6,12,3);
sayText('你好世界',7,10,3);
}
-
Using a call to sayText(), specifying the text:
Play Audio
-
Example : When the API is loaded, using the API loaded callback:
<html>
<head>
<script language="JavaScript" type="text/javascript" src="http://vhss-d.oddcast.com/vocalware_embed_functions.php?acc=3314795&js=1"></script>
<script language="JavaScript" type="text/javascript">
function vw_apiLoaded() {
sayText('...Hello world...', 3, 1, 3);
sayText('...Hallo Welt...', 1, 3, 2);
sayText('...Bonjour tout le monde...', 1, 4, 2);
sayText('こんにちは世界', 6, 12, 3);
sayText('你好世界', 7, 10, 3);
}
</script>
</head>
<body>
<!-- This function call needs to be in or after the body tag -->
<script language="JavaScript" type="text/javascript">
AC_Vocalware_Embed(3314795, 1, 1, '', 1, 1, 2504354, 0, 1, 0, 'e704f7a6017aab05093b2cb079e00e4e', 9);
</script>
<div align="center" style="padding-left: 130px;">
</div>
</body>
</html>
Example : Using a call to sayText()
<html>
<head>
<script language="JavaScript" type="text/javascript" src="http://vhss-d.oddcast.com/vocalware_embed_functions.php?acc=3314795&js=1"></script>
</head>
<body>
<!-- This function call needs to be in or after the body tag -->
<script language="JavaScript" type="text/javascript">
AC_Vocalware_Embed(3314795, 1, 1, '', 1, 1, 2504354, 0, 1, 0, 'e704f7a6017aab05093b2cb079e00e4e', 9);
</script>
<a style=" font-size:120%;" href="javascript:sayText('I can say anything you like, in over 25 languages',3,1,3);">Play Audio</a>
</body>
</html>
Example : Letting the user enter the text in a form:
<html>
<head>
<script language="JavaScript" type="text/javascript" src="http://vhss-d.oddcast.com/vocalware_embed_functions.php?acc=3314795&js=1"></script>
</head>
<body>
<!-- This function call needs to be in or after the body tag -->
<script language="JavaScript" type="text/javascript">
AC_Vocalware_Embed(3314795, 1, 1, '', 1, 1, 2504354, 0, 1, 0, 'e704f7a6017aab05093b2cb079e00e4e', 9);
</script>
<form name="myForm" class="form">
Letting the user enter the text in a form:<br><br>
<input type="text" name="textToSay" size="18" class="form" onkeydown="return (event.keyCode!=13);" value="">
<input type="button" value="Hear It!" name="SayButton" onclick="javascript:sayText(myForm.textToSay.value,3,1,3)" class="form">
</form>
</body>
</html>
|
|