edu.cmu.sphinx.frontend
Class FloatData

java.lang.Object
  extended by edu.cmu.sphinx.frontend.FloatData
All Implemented Interfaces:
Data, java.io.Serializable, java.lang.Cloneable

public class FloatData
extends java.lang.Object
implements Data, java.lang.Cloneable

A Data object that holds data of primitive type float.

See Also:
Data, Serialized Form

Constructor Summary
FloatData(float[] values, int sampleRate, long collectTime, long firstSampleNumber)
          Constructs a Data object with the given values, sample rate, collect time, and first sample number.
 
Method Summary
 FloatData clone()
           
 long getCollectTime()
          Returns the time in milliseconds at which the audio data is collected.
 long getFirstSampleNumber()
           
 int getSampleRate()
           
 float[] getValues()
           
static FloatData toFloatData(Data data)
          Converts a given Data-object into a FloatData if possible.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatData

public FloatData(float[] values,
                 int sampleRate,
                 long collectTime,
                 long firstSampleNumber)
Constructs a Data object with the given values, sample rate, collect time, and first sample number.

Parameters:
values - the data values
sampleRate - the sample rate of the data
collectTime - the time at which this data is collected
firstSampleNumber - the position of the first sample in the original data
Method Detail

getValues

public float[] getValues()
Returns:
the values of this data.

getSampleRate

public int getSampleRate()
Returns:
the sample rate of this data.

getFirstSampleNumber

public long getFirstSampleNumber()
Returns:
the position of the first sample in the original data. The very first sample number is zero.

getCollectTime

public long getCollectTime()
Returns the time in milliseconds at which the audio data is collected.

Returns:
the difference, in milliseconds, between the time the audio data is collected and midnight, January 1, 1970

clone

public FloatData clone()
                throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

toFloatData

public static FloatData toFloatData(Data data)
Converts a given Data-object into a FloatData if possible.

Parameters:
data -