edu.cmu.sphinx.frontend.util
Class ConcatAudioFileDataSource
java.lang.Object
edu.cmu.sphinx.util.props.ConfigurableAdapter
edu.cmu.sphinx.frontend.BaseDataProcessor
edu.cmu.sphinx.frontend.util.AudioFileDataSource
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
|
Method Summary |
java.util.List<java.lang.String> |
getReferences()
Returns a list of all reference text. |
void |
initialize()
Initializes a ConcatFileDataSource. |
private static java.util.List<java.net.URL> |
readDriver(java.lang.String fileName)
Reads and verifies a driver file. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
nextFile
private java.net.URL nextFile
referenceList
private java.util.List<java.lang.String> referenceList
isInitialized
private boolean isInitialized
batchFiles
java.util.List<java.net.URL> batchFiles
ConcatAudioFileDataSource
public ConcatAudioFileDataSource(int bytesPerRead,
java.util.List<AudioFileProcessListener> listeners)
ConcatAudioFileDataSource
public ConcatAudioFileDataSource()
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)
readDriver
private static java.util.List<java.net.URL> readDriver(java.lang.String fileName)
- Reads and verifies a driver file.
- Parameters:
fileName -
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 usestreamName - 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