@Override public void initialize() { super.initialize(); for (DataProcessor dp : frontEndList) { dp.initialize(); } }
/** * Returns the data values. * * @return the data values */ public double[] getValues() { return data.getValues(); }
/** * Sets the source of data for this front end. It basically sets the predecessor of the first DataProcessor of this * front end. * * @param dataSource the source of data */ public void setDataSource(DataProcessor dataSource) { first.setPredecessor(dataSource); }
/** * Converts DoubleData object to FloatDatas. * @param data data to convert * @return converted data */ public static DoubleData FloatData2DoubleData(FloatData data) { int numSamples = data.getValues().length; double[] doubleData = new double[numSamples]; float[] values = data.getValues(); for (int i = 0; i < values.length; i++) { doubleData[i] = values[i]; } return new DoubleData(doubleData, data.getSampleRate(), data.getFirstSampleNumber()); }
public FrontEnd(List<DataProcessor> frontEndList) { initLogger(); this.frontEndList = frontEndList; init(); }
/** * Returns the string "DataEndSignal". * * @return the string "DataEndSignal" */ @Override public String toString() { return ("DataEndSignal: creation time: " + getTime() + ", duration: " + getDuration() + "ms"); } }
private void initFrontEnd(FrontEnd newFrontEnd) { if (frontEnd == null) { frontEnd = newFrontEnd; frontEnd.addSignalListener(this); } else if (frontEnd != newFrontEnd) { frontEnd.removeSignalListener(this); frontEnd = newFrontEnd; frontEnd.addSignalListener(this); } }
@Override public void initialize() { super.initialize(); // reset all stream tags streamEndReached = false; utteranceEndSent = false; utteranceStarted = false; if (bytesPerRead % 2 == 1) { bytesPerRead++; } }
@Override public void newProperties(PropertySheet ps) throws PropertyException { super.newProperties(ps); logger = ps.getLogger(); maxRepeatedMs = ps.getDouble(RandomSampleRepeater.PROP_MAX_REAPTED_MS); uDistWidthSec = ps.getDouble(RandomSampleRepeater.PROP_UNIFORM_DIST_WIDTH); useRandSeed = ps.getBoolean(RandomSampleRepeater.PROP_USE_RANDSEED); randStreamStart = ps.getBoolean(RandomSampleRepeater.PROP_RAND_STREAM_START); sampleRate = ps.getInt(RandomSampleRepeater.PROP_SAMPLE_RATE); initialize(); }
/** * Returns the position of the first sample in the original data. The very first sample number is zero. * * @return the position of the first sample in the original data */ public long getFirstSampleNumber() { return data.getFirstSampleNumber(); }
/** * Sets the predecessor for this DataProcessor. The predecessor is actually * the spectrum builder. * * @param predecessor the predecessor of this DataProcessor */ @Override public void setPredecessor(DataProcessor predecessor) { filterBank.setPredecessor(predecessor); }
/** * Returns the time in milliseconds at which the audio data is collected. * * @return the difference, in milliseconds, between the time the audio data is collected and midnight, January 1, * 1970 */ public long getCollectTime() { return data.getCollectTime(); }
/** * Returns the string "DataStartSignal". * * @return the string "DataStartSignal" */ @Override public String toString() { return "DataStartSignal: creation time: " + getTime(); }
/** Sets the feature for this Token. * @param data features */ public void setData(Data data) { this.data = data; if (data instanceof FloatData) { collectTime = ((FloatData)data).getCollectTime(); } }
/** * @param blockSizeMs block size in milliseconds */ public DataBlocker(double blockSizeMs) { initLogger(); this.blockSizeMs = blockSizeMs; }
/** * @return a string that describes the data. */ @Override public String toString() { return "SpeechClassifiedData containing " + data.toString() + " classified as " + (isSpeech ? "speech" : "non-speech"); } }
public void prepareForNewStream() { if (randStreamStart) nextInsertionPoint = 0; else nextInsertionPoint = computeNextInsertionPoint(); // reset the number of inserted samples numInsertedSamples = 0; }
@Override public void initialize() { super.initialize(); for (DataProcessor dataProcessor : selectedDataProcessors) dataProcessor.initialize(); }
/** Initializes this PLPFrequencyFilterBank object */ @Override public void initialize() { super.initialize(); }
/** Initializes this LiveCMN. */ @Override public void initialize() { super.initialize(); }