edu.cmu.sphinx.frontend.util
Class ConcatAudioFileDataSource

java.lang.Object
  extended by edu.cmu.sphinx.frontend.BaseDataProcessor
      extended by edu.cmu.sphinx.frontend.util.AudioFileDataSource
          extended by edu.cmu.sphinx.frontend.util.ConcatAudioFileDataSource
All Implemented Interfaces:
DataProcessor, Configurable, ReferenceSource

public class ConcatAudioFileDataSource
extends AudioFileDataSource
implements ReferenceSource

Concatenates a list of audio files as one continuous audio stream.

A DataStartSignal will be placed before the start of the first file, and a DataEndSignal after the last file. No DataStartSignal or DataEndSignal will be placed between them.

Author:
Holger Brandl

Field Summary
 
Fields inherited from class edu.cmu.sphinx.frontend.util.AudioFileDataSource
AUDIO_FILE_LISTENERS, PROP_BYTES_PER_READ, PROP_BYTES_PER_READ_DEFAULT
 
Constructor Summary
ConcatAudioFileDataSource()
           
ConcatAudioFileDataSource(int bytesPerRead)
           
 
Method Summary
 java.util.List<java.lang.String> getReferences()
          Returns a list of all reference text.
 void initialize()
          Initializes a ConcatFileDataSource.
 void setAudioFile(java.net.URL audioFileURL, java.lang.String streamName)
          Sets the audio file from which the data-stream will be generated of.
 void setBatchFile(java.io.File batchFile)
           
 void setBatchFiles(java.util.List<java.io.File> files)
           
 void setBatchUrls(java.util.List<java.net.URL> urls)
           
 
Methods inherited from class edu.cmu.sphinx.frontend.util.AudioFileDataSource
addNewFileListener, getData, getSampleRate, isBigEndian, newProperties, removeNewFileListener, setAudioFile, setInputStream
 
Methods inherited from class edu.cmu.sphinx.frontend.BaseDataProcessor
getPredecessor, getTimer, setPredecessor, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConcatAudioFileDataSource

public ConcatAudioFileDataSource()

ConcatAudioFileDataSource

public ConcatAudioFileDataSource(int bytesPerRead)
Method Detail

initialize

public void initialize()
Initializes a ConcatFileDataSource.

Specified by:
initialize in interface DataProcessor
Overrides:
initialize in class AudioFileDataSource

setBatchFile

public void setBatchFile(java.io.File batchFile)

setBatchFiles

public void setBatchFiles(java.util.List<java.io.File> files)

setBatchUrls

public void setBatchUrls(java.util.List<java.net.URL> urls)

setAudioFile

public void setAudioFile(java.net.URL audioFileURL,
                         java.lang.String streamName)
Description copied from class: AudioFileDataSource
Sets the audio file from which the data-stream will be generated of.

Overrides:
setAudioFile in class AudioFileDataSource
Parameters:
audioFileURL - The location of the audio file to use
streamName - The name of the InputStream. if null the complete path of the audio file will be uses as stream name.

getReferences

public java.util.List<java.lang.String> getReferences()
Returns a list of all reference text. Implements the getReferences() method of ReferenceSource.

Specified by:
getReferences in interface ReferenceSource
Returns:
a list of all reference text