Build 1.0_r1(from source)

android.speech.recognition.impl
Class VoicetagItemImpl

java.lang.Object
  extended by android.speech.recognition.VoicetagItem
      extended by android.speech.recognition.impl.VoicetagItemImpl
All Implemented Interfaces:
SlotItem, Runnable

public class VoicetagItemImpl
extends VoicetagItem
implements Runnable


Constructor Summary
VoicetagItemImpl(long nativeObject, boolean fromfile)
          Creates a new VoicetagItemImpl.
 
Method Summary
static VoicetagItem create(String filename, VoicetagItemListener listener)
          Creates a VoicetagItem from a file
protected  void finalize()
          Called by the virtual machine when there are no longer any (non-weak) references to the receiver.
 byte[] getAudio()
          Returns the audio used to construct the VoicetagItem.
 long getNativeObject()
           
 void load()
          Load a Voicetag.
 void run()
          Begin doing the active part of the class' code.
 void save(String path)
          Save the Voicetag.
 void setAudio(byte[] waveform)
          Sets the audio used to construct the Voicetag.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VoicetagItemImpl

public VoicetagItemImpl(long nativeObject,
                        boolean fromfile)
Creates a new VoicetagItemImpl.

Parameters:
nativeObject - the pointer to the native object
Method Detail

run

public void run()
Description copied from interface: Runnable
Begin doing the active part of the class' code.

Specified by:
run in interface Runnable

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 byte[] getAudio()
                throws IllegalStateException
Returns the audio used to construct the VoicetagItem.

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

setAudio

public void setAudio(byte[] waveform)
              throws IllegalArgumentException,
                     IllegalStateException
Sets the audio used to construct the Voicetag.

Specified by:
setAudio in class VoicetagItem
Parameters:
waveform - the endpointed waveform
Throws:
IllegalArgumentException - if waveform is null or empty.
IllegalStateException - if the recognition parameter 'enableGetWaveform' is not set

save

public void save(String path)
          throws IllegalArgumentException
Save the Voicetag.

Specified by:
save in class VoicetagItem
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.

load

public void load()
          throws IllegalStateException
Load a Voicetag.

Specified by:
load in class VoicetagItem
Throws:
IllegalStateException - if voicetag has not been created from a file.

getNativeObject

public long getNativeObject()

finalize

protected void finalize()
                 throws Throwable
Description copied from class: Object
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. Subclasses can use this facility to guarantee that any associated resources are cleaned up before the receiver is garbage collected. Uncaught exceptions which are thrown during the running of the method cause it to terminate immediately, but are otherwise ignored.

Note: The virtual machine assumes that the implementation in class Object is empty.

Overrides:
finalize in class Object
Throws:
Throwable - The virtual machine ignores any exceptions which are thrown during finalization.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature