public class VoiceDataDumper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected FeatureDefinition |
featureDefinition |
protected FeatureFileReader |
featureFileReader |
protected int |
halfphoneLRFeatureIndex |
protected long |
numSamples |
protected int |
phoneFeatureIndex |
protected UnitDatabase |
unitDB |
| Constructor and Description |
|---|
VoiceDataDumper() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
byteswap(int val) |
protected short |
byteswap(short val) |
protected void |
dumpAudio(String fileName)
Adapted from
WavWriter.export(String, int, byte[]) and
WavWriter.doWrite(String, int) |
protected void |
dumpData(String voiceName)
Get file names from voice config file.
|
protected void |
dumpTextGrid(String fileName)
Dump units to Praat TextGrid.
|
protected double |
getDuration(Datagram[] datagrams)
Get total duration of a Datagram array
|
protected byte[] |
getSamples(Datagram[] datagrams)
Get raw samples from all Datagrams in an array
|
protected TimelineReader |
loadAudioTimeline(String fileName)
Load audio timeline from file
|
protected void |
loadFeatureFile(String fileName)
Load unit feature file from file
|
protected void |
loadUnitDatabase(String audioTimelineFileName,
String basenameTimelineFileName,
String unitFileName)
Load unit database from various relevant files
|
static void |
main(String[] args)
Main method.
|
protected UnitDatabase unitDB
protected FeatureFileReader featureFileReader
protected long numSamples
protected FeatureDefinition featureDefinition
protected int phoneFeatureIndex
protected int halfphoneLRFeatureIndex
protected int byteswap(int val)
val - valWavWriter.byteswap(int)protected short byteswap(short val)
val - valWavWriter.byteswap(short)protected TimelineReader loadAudioTimeline(String fileName) throws IOException, MaryConfigurationException
fileName - to loadIOException - IOExceptionMaryConfigurationException - MaryConfigurationExceptionprotected void loadUnitDatabase(String audioTimelineFileName, String basenameTimelineFileName, String unitFileName) throws IOException, MaryConfigurationException
audioTimelineFileName - to loadbasenameTimelineFileName - to loadunitFileName - to loadIOException - IOExceptionMaryConfigurationException - MaryConfigurationExceptionprotected void loadFeatureFile(String fileName) throws IOException, MaryConfigurationException
fileName - to loadIOException - IOExceptionMaryConfigurationException - MaryConfigurationExceptionprotected double getDuration(Datagram[] datagrams)
datagrams - whose duration to getprotected byte[] getSamples(Datagram[] datagrams) throws IOException
datagrams - whose samples to getIOException - IOExceptionprotected void dumpTextGrid(String fileName) throws IOException
fileName - of new TextGridIOException - if data files cannot be read, or TextGrid cannot be writtenprotected void dumpAudio(String fileName) throws IOException
WavWriter.export(String, int, byte[]) and
WavWriter.doWrite(String, int)fileName - fileNameIOException - IOExceptionprotected void dumpData(String voiceName) throws Exception
voiceName - for config file to read (e.g. "bits3")Exception - ExceptionCopyright © 2000–2016 DFKI GmbH. All rights reserved.