marytts.unitselection.data
Class HnmTimelineReader

java.lang.Object
  extended by marytts.unitselection.data.TimelineReader
      extended by marytts.unitselection.data.HnmTimelineReader

public class HnmTimelineReader
extends TimelineReader

A reader class for the harmonics plus noise timeline file.

Author:
Oytun Türk

Nested Class Summary
 
Nested classes/interfaces inherited from class marytts.unitselection.data.TimelineReader
TimelineReader.IdxField, TimelineReader.Index, TimelineReader.ProcHeader
 
Field Summary
 HntmAnalyzerParams analysisParams
           
 
Fields inherited from class marytts.unitselection.data.TimelineReader
datagramsBytePos, idx, maryHdr, numDatagrams, procHdr, sampleRate, timeIdxBytePos, totalDuration
 
Constructor Summary
HnmTimelineReader(java.lang.String fileName)
           
 
Method Summary
protected  Datagram getNextDatagram(java.nio.ByteBuffer bb)
          Read and return the upcoming datagram from the given byte buffer.
protected  void load(java.lang.String fileName)
          Load a timeline from a file.
static void main(java.lang.String[] args)
          Dump audio from HNM timeline to a series big-endian raw audio files in chunks of Datagrams (clusterSize).
 
Methods inherited from class marytts.unitselection.data.TimelineReader
computeTotalDuration, getByteBufferAtTime, getDatagram, getDatagram, getDatagrams, getDatagrams, getDatagrams, getDatagrams, getDatagrams, getDatagrams, getDatagramsBytePos, getIndex, getNumDatagrams, getProcHeaderContents, getSampleRate, getTotalDuration, hopToTime, scaleTime, skipNextDatagram, unScaleTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

analysisParams

public HntmAnalyzerParams analysisParams
Constructor Detail

HnmTimelineReader

public HnmTimelineReader(java.lang.String fileName)
                  throws java.io.IOException,
                         MaryConfigurationException
Throws:
java.io.IOException
MaryConfigurationException
Method Detail

load

protected void load(java.lang.String fileName)
             throws java.io.IOException,
                    MaryConfigurationException
Description copied from class: TimelineReader
Load a timeline from a file.

Overrides:
load in class TimelineReader
Parameters:
fileName - The file to read the timeline from. Must be non-null and point to a valid timeline file.
Throws:
java.io.IOException - if a problem occurs during reading
MaryConfigurationException - if fileName does not point to a valid timeline file

getNextDatagram

protected Datagram getNextDatagram(java.nio.ByteBuffer bb)
                            throws java.io.IOException
Read and return the upcoming datagram from the given byte buffer. Subclasses should override this method to create subclasses of Datagram.

Overrides:
getNextDatagram in class TimelineReader
Parameters:
bb - the timeline byte buffer to read from
Returns:
the current datagram, or null if EOF was encountered
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws javax.sound.sampled.UnsupportedAudioFileException,
                        java.io.IOException,
                        MaryConfigurationException
Dump audio from HNM timeline to a series big-endian raw audio files in chunks of Datagrams (clusterSize). Run this with
 -ea - Xmx2gb
 

Parameters:
args -
  1. path to timeline_hnm.mry file
  2. path to dump output files
Throws:
java.io.IOException
javax.sound.sampled.UnsupportedAudioFileException
MaryConfigurationException