The PlayAttributes class

The PlayAttributes class determines whether a caller can interrupt a prompt played using the Call.playAndGetInput() method. The default is to allow a message to be interrupted by DTMF key but not by voice. The class has two properties, DTMFInterruptible and voiceInterruptible. Each property has two values:

DTMFInterruptible
  • PlayAttributes.NO_DTMF: the prompt cannot be interrupted by DTMF key presses.
  • PlayAttributes.FIRST_DTMF: the first DTMF key pressed by the caller will interrupt the prompt.
voiceInterruptible
  • PlayAttributes.NO_VOICE: the prompt cannot be interrupted by voice.
  • PlayAttributes.VOICE_ENERGY: the prompt will be interrupted as soon as the caller starts to speak. If the caller interrupts by speaking, the utterance is assumed to be voice input and is sent to the voice recognizer.
The constructor methods for this class are:
PlayAttributes()
Constructs a PlayAttributes object with default properties DTMFInterruptible=PlayAttributes.FIRST_DTMF and voiceInterruptible=PlayAttributes.NO_VOICE.
PlayAttributes(int dtmfInterruptible, int voiceInterruptible)
Constructs a PlayAttributes object with the specified properties.
For example:
public class myVoiceApp extends WVRApplication {
  .
  .
  .
  // Create the attributes object - use empty constructors so that attributes have
  // default values
  public PlayAttributes myPlayAtts = new PlayAttributes();
  // Then change the attributes you need
  myPlayAtts.setDTMFInterruptible(PlayAttributes.NO_DTMF);
  myPlayAtts.setVoiceInterruptible(PlayAttributes.VOICE_ENERGY);
  .
  .
  .
}