The RecoAttributes class

The RecoAttributes class determines the speech recognition settings for a prompt played using the Call.playAndGetInput() method. You must have speech recognition technology configured on the telephony server in order to use this class. If the application does not use speech recognition, use null in place of RecoAttributes.

This class has three properties, each with set and get methods:
  • context: a string to be passed to the speech recognition plug-in to indicate what vocabulary or grammar should be used for the recognition attempt. The precise meaning depends on the plug-in. The string is typically a short identifier such as "numbers" or "months", which is used by the plug-in to select a suitable grammar.
  • nBest: the maximum number of possible recognition results to return from the recognizer.
  • beep: specifies whether or not a pacing tone is played after the prompt to indicate to the caller when to start speaking. Speech recognition starts after the tone.
    Note: Beep and interruptible are mutually exclusive. Speech recognition will fail if both options are set. If a starting beep is used, the PlayAttributes.VOICE_INTERRUPTIBLE property must be set to PlayAttributes.NO_VOICE.
The constructor methods for this class are:
Constructs a RecoAttributes object with default properties context="", nBest=1, beep=true.
RecoAttributes(java.lang.String context, int nBest, boolean beep)
Constructs a RecoAttributes object with the specified context, nBest value and beep.
For example:
public class myVoiceApp extends WVRApplication {
  // Create the attributes object - use empty constructors so that attributes have
  // default values
  public RecoAttributes myRecoAtts = new RecoAttributes();
  // Then change the attributes you need