inpro.incremental.processor
Class AudioActionManager

java.lang.Object
  extended by inpro.incremental.PushBuffer
      extended by inpro.incremental.IUModule
          extended by inpro.incremental.processor.AudioActionManager
All Implemented Interfaces:
edu.cmu.sphinx.instrumentation.Resetable, edu.cmu.sphinx.util.props.Configurable, AbstractFloorTracker.Listener
Direct Known Subclasses:
IUNetworkActionManager

public class AudioActionManager
extends IUModule
implements AbstractFloorTracker.Listener


Nested Class Summary
static interface AudioActionManager.Listener
          Interface for dialogue manager (or other previous modules) to implement.
 
Nested classes/interfaces inherited from class inpro.incremental.IUModule
IUModule.RightBuffer
 
Field Summary
protected  java.util.List<AudioActionManager.Listener> amListeners
          List of components that listen to AM output
protected  DispatchStream audioDispatcher
          Audio output steam
protected static java.lang.String audioPath
          Audio file location
protected  IUBasedFloorTracker floorTracker
          The floor tracker
static java.lang.String PROP_AUDIO_PATH
          Config for audio file location
static java.lang.String PROP_DISPATCHER
          Config for audio output steam
static java.lang.String PROP_FLOOR_TRACKER
          Config for floor tracker
static java.lang.String PROP_STATE_LISTENERS
          Config for list of components that listen to AM output
static java.lang.String PROP_UTTERANCE_MAP
          Configuration for reading utterance audio files from an external file.
protected  IUList<DialogueActIU> toPerform
          List of dialogue act IUs to perform whenever possible.
protected static java.lang.String utteranceMapFile
          The utterance map file name
 
Fields inherited from class inpro.incremental.IUModule
iulisteners, logger, PROP_HYP_CHANGE_LISTENERS, PROP_LOG_TO_TEDVIEW, PROP_TEDVIEW_LOG_ADDRESS, PROP_TEDVIEW_LOG_PORT, rightBuffer, tedLogAdapter
 
Constructor Summary
AudioActionManager()
           
 
Method Summary
 void floor(AbstractFloorTracker.Signal signal, AbstractFloorTracker floorManager)
          When the floor changes, react: If floor is taken, be quiet If floor is available, speak queued IUs' utterance (from file if one is available, via TTS otherwise).
 void leftBufferUpdate(java.util.Collection<? extends IU> ius, java.util.List<? extends EditMessage<? extends IU>> edits)
          Remembers what the current left buffer dialogue act IUs are.
 void newProperties(edu.cmu.sphinx.util.props.PropertySheet ps)
           
 void reset()
           
 void shutUp()
          Shuts up current audio by clearing dispatcher's audio stream.
protected  void signalListeners(DialogueActIU iu)
          Notifies listeners that a DialogueActIU has been performed.
 
Methods inherited from class inpro.incremental.IUModule
getTime, hypChange, logToTedView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_UTTERANCE_MAP

@S4String(mandatory=false)
public static final java.lang.String PROP_UTTERANCE_MAP
Configuration for reading utterance audio files from an external file.

See Also:
Constant Field Values

utteranceMapFile

protected static java.lang.String utteranceMapFile
The utterance map file name


PROP_STATE_LISTENERS

@S4ComponentList(type=AudioActionManager.Listener.class)
public static final java.lang.String PROP_STATE_LISTENERS
Config for list of components that listen to AM output

See Also:
Constant Field Values

amListeners

protected java.util.List<AudioActionManager.Listener> amListeners
List of components that listen to AM output


PROP_DISPATCHER

@S4Component(type=DispatchStream.class)
public static final java.lang.String PROP_DISPATCHER
Config for audio output steam

See Also:
Constant Field Values

audioDispatcher

protected DispatchStream audioDispatcher
Audio output steam


PROP_FLOOR_TRACKER

@S4Component(type=IUBasedFloorTracker.class)
public static final java.lang.String PROP_FLOOR_TRACKER
Config for floor tracker

See Also:
Constant Field Values

floorTracker

protected IUBasedFloorTracker floorTracker
The floor tracker


PROP_AUDIO_PATH

@S4String(mandatory=false)
public static final java.lang.String PROP_AUDIO_PATH
Config for audio file location

See Also:
Constant Field Values

audioPath

protected static java.lang.String audioPath
Audio file location


toPerform

protected IUList<DialogueActIU> toPerform
List of dialogue act IUs to perform whenever possible.

Constructor Detail

AudioActionManager

public AudioActionManager()
Method Detail

newProperties

public void newProperties(edu.cmu.sphinx.util.props.PropertySheet ps)
                   throws edu.cmu.sphinx.util.props.PropertyException
Specified by:
newProperties in interface edu.cmu.sphinx.util.props.Configurable
Overrides:
newProperties in class IUModule
Throws:
edu.cmu.sphinx.util.props.PropertyException

leftBufferUpdate

public void leftBufferUpdate(java.util.Collection<? extends IU> ius,
                             java.util.List<? extends EditMessage<? extends IU>> edits)
Remembers what the current left buffer dialogue act IUs are. Performs them later when floor is availabe.

Specified by:
leftBufferUpdate in class IUModule
Parameters:
ius - list of IUs that make up the current hypothesis
edits - a list of edits since the last call

floor

public void floor(AbstractFloorTracker.Signal signal,
                  AbstractFloorTracker floorManager)
When the floor changes, react: If floor is taken, be quiet If floor is available, speak queued IUs' utterance (from file if one is available, via TTS otherwise).

Specified by:
floor in interface AbstractFloorTracker.Listener
Parameters:
signal - the signal describing the change in the floor
floorManager - the floor manager itself. in this way a consumer can request e.g. to change timeouts

signalListeners

protected void signalListeners(DialogueActIU iu)
Notifies listeners that a DialogueActIU has been performed.

Parameters:
iu - the performed IU.

shutUp

public void shutUp()
Shuts up current audio by clearing dispatcher's audio stream.


reset

public void reset()
Specified by:
reset in interface edu.cmu.sphinx.instrumentation.Resetable
Overrides:
reset in class PushBuffer