Asterisk-Java

org.asteriskjava.fastagi.command
Class SpeechRecognizeCommand

java.lang.Object
  extended by org.asteriskjava.fastagi.command.AbstractAgiCommand
      extended by org.asteriskjava.fastagi.command.SpeechRecognizeCommand
All Implemented Interfaces:
java.io.Serializable, AgiCommand

public class SpeechRecognizeCommand
extends AbstractAgiCommand

Plays back given prompt while listening for speech and dtmf.

Available since Asterisk 1.6.

Since:
1.0.0
Version:
$Id: SpeechRecognizeCommand.java 1013 2008-03-31 06:51:03Z srt $
Author:
srt
See Also:
Serialized Form

Constructor Summary
SpeechRecognizeCommand(java.lang.String prompt, int timeout)
          Creates a new SpeechRecognizeCommand that plays the given prompt and listens for for speech and dtmf.
SpeechRecognizeCommand(java.lang.String prompt, int timeout, int offset)
          Creates a new SpeechRecognizeCommand that plays the given prompt and listens for for speech and dtmf.
 
Method Summary
 java.lang.String buildCommand()
          Returns a string suitable to be sent to asterisk.
 int getOffset()
          Returns the offset samples to skip when playing the prompt.
 java.lang.String getPrompt()
          Returns the prompt to play.
 int getTimeout()
          Returns the maximum recognition time in milliseconds.
 void setOffset(int offset)
          Sets the offset samples to skip when playing the prompt.
 void setPrompt(java.lang.String prompt)
          Sets the prompt to play.
 void setTimeout(int timeout)
          Sets the maximum recognition time in milliseconds.
 
Methods inherited from class org.asteriskjava.fastagi.command.AbstractAgiCommand
escapeAndQuote, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpeechRecognizeCommand

public SpeechRecognizeCommand(java.lang.String prompt,
                              int timeout)
Creates a new SpeechRecognizeCommand that plays the given prompt and listens for for speech and dtmf.

Parameters:
prompt - the prompt to play.
timeout - the maximum recognition time in milliseconds.

SpeechRecognizeCommand

public SpeechRecognizeCommand(java.lang.String prompt,
                              int timeout,
                              int offset)
Creates a new SpeechRecognizeCommand that plays the given prompt and listens for for speech and dtmf.

Parameters:
prompt - the prompt to play.
timeout - the maximum recognition time in milliseconds.
offset - the offset samples to skip when playing the prompt.
Method Detail

getPrompt

public java.lang.String getPrompt()
Returns the prompt to play.

Returns:
the prompt to play.

setPrompt

public void setPrompt(java.lang.String prompt)
Sets the prompt to play.

Parameters:
prompt - the prompt to play.

getTimeout

public int getTimeout()
Returns the maximum recognition time in milliseconds.

Returns:
the maximum recognition time in milliseconds.

setTimeout

public void setTimeout(int timeout)
Sets the maximum recognition time in milliseconds.

Parameters:
timeout - the maximum recognition time in milliseconds, or -1 for no timeout.

getOffset

public int getOffset()
Returns the offset samples to skip when playing the prompt.

Returns:
the offset samples to skip when playing the prompt.

setOffset

public void setOffset(int offset)
Sets the offset samples to skip when playing the prompt.

Parameters:
offset - the offset samples to skip when playing the prompt.

buildCommand

public java.lang.String buildCommand()
Description copied from interface: AgiCommand
Returns a string suitable to be sent to asterisk.

Specified by:
buildCommand in interface AgiCommand
Specified by:
buildCommand in class AbstractAgiCommand
Returns:
a string suitable to be sent to asterisk.

Asterisk-Java

Copyright © 2004-2009 Stefan Reuter. All Rights Reserved.