Preload Text-to-Speech

When timing is critical, you may want to pre-load your TTS audio.


You may pre-load a Text to Speech audio in order to achieve a faster effect when calling the sayText() command:
  1. Call the loadAudio() command: loadText('The text is ready',3,1,3)

  2. Use the Javascript event function vh_ttsLoaded(args) in the HEAD section to check if the audio track is loaded: "function vh_ttsLoaded(args){"
    In this example you will see a JavaScript alert displayed when the text is ready.


  3. When the text is loaded, play it using the sayText() command:
    "sayText(args, 3,1,3);"


    Note: In this example we check to see if the text was loaded and only then call sayText().


© 2003 Oddcast Inc. All Right Reserved