/** * Returns the processed Data output, basically calls * <code>getData()</code> on the last processor. * * @return a Data object that has been processed by the cepstrum * @throws DataProcessingException if a data processor error occurs */ @Override public Data getData() throws DataProcessingException { DataProcessor dp; dp = selectedDataProcessors.get(selectedDataProcessors.size() - 1); return dp.getData(); }
private Data getNextData() throws DataProcessingException { Data d = getPredecessor().getData(); while (d != null && !(d instanceof DoubleData || d instanceof DataEndSignal || d instanceof DataStartSignal || d instanceof SpeechEndSignal)) { outputQueue.add(d); d = getPredecessor().getData(); } return d; }
/** * Read a Data object from the predecessor DataProcessor, and increment the ID count appropriately. * * @return the read Data object * @throws edu.cmu.sphinx.frontend.DataProcessingException */ private Data readData() throws DataProcessingException { Data frame = getPredecessor().getData(); if (frame != null) { id++; } return frame; } }
@Override public Data getData() throws DataProcessingException { Data d = getPredecessor().getData(); assert isAudioStreamContinuous(d) : "audio stream is not continuous"; return d; }
/** * Reads and returns the next Data object from this DataProcessor, return * null if there is no more audio data. * * @return the next Data or <code>null</code> if none is available * @throws DataProcessingException * if there is a data processing error */ @Override public Data getData() throws DataProcessingException { Data input = getPredecessor().getData(); dumpData(input); return input; }
/** * Reads and returns the next Data frame or return <code>null</code> if no data is available. * * @return the next Data or <code>null</code> if none is available * @throws edu.cmu.sphinx.frontend.DataProcessingException * if there is a data processing error */ @Override public Data getData() throws DataProcessingException { Data input = getPredecessor().getData(); for (DataListener l : listeners) l.processDataFrame(input); return input; }
/** * Returns the next DoubleData object, which is the mel cepstrum of the input frame. Signals are returned * unmodified. * * @return the next available DoubleData melcepstrum, or Signal object, or null if no Data is available * @throws DataProcessingException if a data processing error occurred */ @Override public Data getData() throws DataProcessingException { Data input = getPredecessor().getData(); // get the spectrum if (input != null && input instanceof DoubleData) { input = process((DoubleData) input); } return input; }
/** * Reads the next Data object, which is the power spectrum of an audio input frame. Signals are returned * unmodified. * * @return the next available Data or Signal object, or returns null if no Data is available * @throws DataProcessingException if there is a data processing error */ @Override public Data getData() throws DataProcessingException { Data input = getPredecessor().getData(); if (input != null) { if (input instanceof DoubleData) { input = process((DoubleData) input); } } return input; } }
/** * Returns the next DoubleData object, which is the lifted mel-cepstrum of * the input mel-cepstrum. Signals are returned unmodified. * * @return the next available DoubleData lifted mel-cepstrum, or Signal * object, or null if no Data is available * @throws DataProcessingException * if a data processing error occurred */ @Override public Data getData() throws DataProcessingException { Data data = getPredecessor().getData(); // get the cepstrum if (data != null && data instanceof DoubleData) { liftCepstrum((DoubleData) data); } return data; }
/** * Returns the next DoubleData object, which is a dithered version of the input * * @return the next available DoubleData object, or null if no Data is available * @throws edu.cmu.sphinx.frontend.DataProcessingException * if a data processing error occurred */ @Override public Data getData() throws DataProcessingException { Data input = getPredecessor().getData(); // get the spectrum if (input != null && ditherMax != 0) { if (input instanceof DoubleData || input instanceof FloatData) { input = process(input); } } return input; }
/** * Reads the next Data object, which is the power spectrum of an audio input frame. However, it can also be other * Data objects like a Signal, which is returned unmodified. * * @return the next available Data object, returns null if no Data object is available * @throws DataProcessingException if there is a data processing error */ @Override public Data getData() throws DataProcessingException { Data input = getPredecessor().getData(); if (input != null) { if (input instanceof DoubleData) { input = process((DoubleData) input); } } return input; } }
/** * Returns the next Data object, which is the PLP cepstrum of the input frame. However, it can also be other Data * objects like a EndPointSignal. * * @return the next available Data object, returns null if no Data object is available * @throws DataProcessingException if there is an error reading the Data objects */ @Override public Data getData() throws DataProcessingException { Data input = getPredecessor().getData(); Data output = input; if (input != null) { if (input instanceof DoubleData) { output = process((DoubleData) input); } } return output; }
/** * Reads the next Data object, which is the power spectrum of an audio * input frame. Signals are returned unmodified. * * @return the next available Data or Signal object, or returns null if no * Data is available * @throws DataProcessingException if there is a data processing error */ @Override public Data getData() throws DataProcessingException { Data input = getPredecessor().getData(); if (input != null) { if (input instanceof DoubleData) { input = process((DoubleData) input); } } return input; } }
/** * Returns the processed Data output, basically calls <code>getData()</code> on the last processor. * * @return Data object that has been processed by this front end * @throws DataProcessingException if a data processor error occurs */ @Override public Data getData() throws DataProcessingException { timer.start(); Data data = last.getData(); // fire the signal listeners if its a signal if (data instanceof Signal) { fireSignalListeners((Signal) data); } timer.stop(); return data; }
/** * Returns the next Data object. * * @return the next Data object, or null if none available * @throws DataProcessingException if a data processing error occurs */ @Override public Data getData() throws DataProcessingException { Data audio = getPredecessor().getData(); if (audio instanceof DataStartSignal) reset(); if (audio instanceof DoubleData) { DoubleData data = (DoubleData) audio; audio = classify(data); } return audio; }
/** * Returns the next Data object being processed by this Preemphasizer, or if it is a Signal, it is returned without * modification. * * @return the next available Data object, returns null if no Data object is available * @throws DataProcessingException if there is a processing error * @see Data */ @Override public Data getData() throws DataProcessingException { Data input = getPredecessor().getData(); if (input != null) { if (input instanceof DoubleData) { applyPreemphasis(((DoubleData) input).getValues()); } else if (input instanceof DataEndSignal || input instanceof SpeechEndSignal) { prior = 0; } } return input; }
@Override public Data getData() throws DataProcessingException { Data d = getPredecessor().getData(); // show the panel only if a microphone is used as data source if (d instanceof DataStartSignal) vuMeterPanel.setVisible(FrontEndUtils.getFrontEndProcessor(this, Microphone.class) != null); if (d instanceof DoubleData) vumeter.calculateVULevels(d); return d; }
@Override public Data getData() throws DataProcessingException { Data data = getPredecessor().getData(); if (data instanceof FloatData) { float[] values = ((FloatData) data).getValues(); if (gainFactor != 1.0) { // apply the gain-factor for (int i = 0; i < values.length; i++) { values[i] *= gainFactor; } } } else if (data instanceof DoubleData) { double[] values = ((DoubleData) data).getValues(); if (gainFactor != 1.0) { // apply the gain-factor for (int i = 0; i < values.length; i++) { values[i] *= gainFactor; } } } return data; }
@Override public Data getData() throws DataProcessingException { Data d = getPredecessor().getData(); if (d instanceof DoubleData && convMode.equals(CONVERT_D2F)) { DoubleData dd = (DoubleData) d; d = new FloatData(MatrixUtils.double2float(dd.getValues()), dd.getSampleRate(), dd.getFirstSampleNumber()); } else if (d instanceof FloatData && convMode.equals(CONVERT_F2D)) { FloatData fd = (FloatData) d; d = new DoubleData(MatrixUtils.float2double(fd.getValues()), fd.getSampleRate(), fd.getFirstSampleNumber()); } return d; } }
/** * Returns the next DoubleData object, which is a dithered version of the input * * @return the next available DoubleData object, or null if no Data is available * @throws edu.cmu.sphinx.frontend.DataProcessingException * if a data processing error occurred */ @Override public Data getData() throws DataProcessingException { Data input = getPredecessor().getData(); // get the spectrum if (input instanceof DataStartSignal) prepareForNewStream(); if (input != null && maxRepeatedMs != 0) { if (input instanceof DoubleData || input instanceof FloatData) { input = process(input); } } return input; }