12.07.2015 Views

Nuance Vocalizer Developer's Guide - Avaya Support

Nuance Vocalizer Developer's Guide - Avaya Support

Nuance Vocalizer Developer's Guide - Avaya Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SpeechObjectsThe Foundation SpeechObjects, <strong>Nuance</strong>’s Java-based speech applicationdevelopment framework, defines classes that let you create specific TTS promptobjects from a simple text string. This class, TTSPrompt, implements the Playableinterface, which allows it to be appended to a prompt queue and playeddirectly:vcommerce.util.prompt.Playablevoid appendTo(PromptPlayer player)<strong>Nuance</strong>SpeechChannelTTSPromptjava.lang.String getText()void setText (java.lang.String text)To use the TTSPrompt class, just set the text string you want to be synthesized.You can then append the prompt to the prompt queue of yourSpeechChannel. For example:TTSPrompt tts = new TTSPrompt("Hello world");tts.appendTo(sc);Note: In this example, sc is the SpeechChannel object being used by yourapplication.If you are programming with the <strong>Nuance</strong>SpeechChannel API directly instead ofusing the Foundation SpeechObjects, use the appendTTS method defined in theCorePromptPlayer interface to create TTS prompts. This method creates theprompt and appends it to the prompt queue.The <strong>Nuance</strong>SpeechChannel class includes a default implementation of theCorePromptPlayer interface. For example, if sc is your <strong>Nuance</strong>SpeechChannelobject, the following appends and plays a TTS prompt:CorePromptPlayer player = sc.getPromptPlayer();player.appendTTS("Hello world");player.play(false);For more information about the <strong>Nuance</strong>SpeechChannel API, see the onlinedocumentation shipped with the <strong>Nuance</strong> System.28<strong>Nuance</strong> <strong>Vocalizer</strong> 3.0Developer’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!