Build 1.0_r1(from source)

android.speech.recognition
Class VoicetagItem

java.lang.Object
  extended by android.speech.recognition.VoicetagItem
All Implemented Interfaces:
SlotItem
Direct Known Subclasses:
VoicetagItemImpl

public abstract class VoicetagItem
extends Object
implements SlotItem

Voicetag that may be inserted into an embedded grammar slot.


Constructor Summary
VoicetagItem()
           
 
Method Summary
static VoicetagItem create(String filename, VoicetagItemListener listener)
          Creates a VoicetagItem from a file
abstract  byte[] getAudio()
          Returns the audio used to construct the VoicetagItem.
abstract  void load()
          Load a Voicetag Item.
abstract  void save(String path)
          Save the Voicetag Item.
abstract  void setAudio(byte[] waveform)
          Sets the audio used to construct the Voicetag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VoicetagItem

public VoicetagItem()
Method Detail

create

public static VoicetagItem create(String filename,
                                  VoicetagItemListener listener)
                           throws IllegalArgumentException,
                                  FileNotFoundException,
                                  IOException
Creates a VoicetagItem from a file

Parameters:
filename - filename for Voicetag
listener - listens for Voicetag events
Returns:
the resulting VoicetagItem
Throws:
IllegalArgumentException - if filename is null or an empty string.
FileNotFoundException - if the specified filename could not be found
IOException - if the specified filename could not be opened

getAudio

public abstract byte[] getAudio()
                         throws IllegalStateException
Returns the audio used to construct the VoicetagItem. The audio is in PCM format and is start-pointed and end-pointed. The audio is only generated if the enableGetWaveform recognition parameter is set prior to recognition.

Returns:
the audio used to construct the VoicetagItem.
Throws:
IllegalStateException - if the recognition parameter 'enableGetWaveform' is not set

setAudio

public abstract void setAudio(byte[] waveform)
                       throws IllegalArgumentException,
                              IllegalStateException
Sets the audio used to construct the Voicetag. The audio is in PCM format and is start-pointed and end-pointed. The audio is only generated if the enableGetWaveform recognition parameter is set prior to recognition.

Parameters:
waveform - the endpointed waveform
Throws:
IllegalArgumentException - if waveform is null or empty.
IllegalStateException - if the recognition parameter 'enableGetWaveform' is not set

save

public abstract void save(String path)
                   throws IllegalArgumentException,
                          IllegalStateException
Save the Voicetag Item.

Parameters:
path - where the Voicetag will be saved. We strongly recommend to set the filename with the same value of the VoicetagId.
Throws:
IllegalArgumentException - if path is null or an empty string.
IllegalStateException

load

public abstract void load()
                   throws IllegalStateException
Load a Voicetag Item.

Throws:
IllegalStateException - if voicetag has not been created from a file.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature