org.jvoicexml.implementation.jsapi10.speakstrategy
Class BreakSpeakStrategy

java.lang.Object
  extended by org.jvoicexml.implementation.jsapi10.speakstrategy.BreakSpeakStrategy
All Implemented Interfaces:
SSMLSpeakStrategy

public final class BreakSpeakStrategy
extends Object

SSML strategy to play back a <mark> node.

Since:
0.5
Version:
$Revision: 2583 $
Author:
Dirk Schnelle-Walka

Constructor Summary
BreakSpeakStrategy()
          Creates a new object.
 
Method Summary
 void setSSMLSpeakStrategyFactory(SSMLSpeakStrategyFactory strategyFactory)
          Sets the factory to produce new speak strategies.
 void speak(Jsapi10SynthesizedOutput output, org.jvoicexml.xml.SsmlNode node)
          Speaks the given node.
protected  void speakChildNodes(Jsapi10SynthesizedOutput synthesizer, org.jvoicexml.xml.SsmlNode node)
          Calls the speak method for all child nodes of the given node.
protected  void waitQueueEmpty(Jsapi10SynthesizedOutput output)
          Waits until the input queue of the synthesizer is empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BreakSpeakStrategy

public BreakSpeakStrategy()
Creates a new object.

Method Detail

speak

public void speak(Jsapi10SynthesizedOutput output,
                  org.jvoicexml.xml.SsmlNode node)
           throws NoresourceError,
                  BadFetchError
Speaks the given node.

Parameters:
output - the synthesizer to use.
node - The node to speak.
Throws:
NoresourceError - No recognizer allocated.
BadFetchError - Recognizer in wrong state.

setSSMLSpeakStrategyFactory

public void setSSMLSpeakStrategyFactory(SSMLSpeakStrategyFactory strategyFactory)
Sets the factory to produce new speak strategies.

Parameters:
strategyFactory - the factory.

speakChildNodes

protected void speakChildNodes(Jsapi10SynthesizedOutput synthesizer,
                               org.jvoicexml.xml.SsmlNode node)
                        throws NoresourceError,
                               BadFetchError
Calls the speak method for all child nodes of the given node.

Parameters:
synthesizer - The synthesized output to use.
node - The current node.
Throws:
NoresourceError - No recognizer allocated.
BadFetchError - Recognizer in wrong state.

waitQueueEmpty

protected void waitQueueEmpty(Jsapi10SynthesizedOutput output)
                       throws NoresourceError
Waits until the input queue of the synthesizer is empty.

This method uses the encapsulated Synthesizer to look at the current queue regardless of what is coming from the voice browser.

Parameters:
output - the current synthesized output
Throws:
NoresourceError - error waiting for an empty queue
Since:
0.7.2


Copyright © 2005-2009JVoiceXML group.