Oddcast Tech Note No. 5 Guidelines For Using The Vhost Text To Speech Api
Oddcast Tech Note No. 5 Guidelines For Using The Vhost Text To Speech Api
Oddcast Tech Note No. 5 Guidelines For Using The Vhost Text To Speech Api
5
Guidelines for using the VHost Text to Speech API
To use Static TTS simply press the 'Add Audio' button and select the TTS option. There is no
need to read any further.
To get started with Dynamic TTS – read this document.
• You want theVHost character to speak when it is first loaded. To do so, you must
add an event callback function to your page to capture the ‘vh_SlideBegin’
callback event. This event indicates that the Scene is loaded and ready to accept
your call (see more information about Event Callback functions in the API
Reference). Add the sayText function call within this callback function.
Example:
<SCRIPT LANGUAGE="JavaScript">
function vh_slideBegin(sceneNumber){
sayText("Welcome to my website!",1,1,1);
}
</SCRIPT>
C. Working Example
See example for Text to Speech implementation using the methods described above.
Right-Click and select ‘View Source’ to see the page source code. Feel free to copy &
paste portions to use in your own page.
D. Troubleshooting
You followed the instructions above but TTS does not work in your page? Here is what
you should look into:
1. Verify that the VHost Embed code has been copied into your page. Make sure that
when copying the VHost code, the option for ‘JavaScript API’ was enabled.
2. Verify that the licensed domain name has been configured properly. In your account
open ‘Account Info”. One of the domain names configured there must be identical to
the domain name you see in your browser’s ‘address’ line – if you strip away the
preceding “http://” and any path information. For example –
Browser address line is: http://www.mycompany.com/abcd/index.html
Licensed domain name should be: www.mycompany.com
Oddcast Media Technologies - Tech Note No. 5 v5.0 3
Mar 1, 2004
3. Verify that the sayText function is indeed being called. The best way to do so is to add
a JavaScript alert just prior to the ‘sayText’ function call. Add the line:
alert(“sayText is called”);
and try again. The alert should come up whenever you expect the VHost to speak. If
you don’t see the alert come up, then your code is not making the function call to
sayText. You need to examine your code.