marytts.unitselection.data
Class HnmDatagram

java.lang.Object
  extended by marytts.unitselection.data.Datagram
      extended by marytts.unitselection.data.HnmDatagram

public class HnmDatagram
extends Datagram

A datagram that encapsulates a harmonics plus noise modelled speech frame

Author:
Oytun Türk

Field Summary
 HntmSpeechFrame frame
           
 
Fields inherited from class marytts.unitselection.data.Datagram
data, duration
 
Constructor Summary
HnmDatagram(java.nio.ByteBuffer bb, int noiseModel)
          Constructor which pops a datagram from a byte buffer.
HnmDatagram(long setDuration, HntmSpeechFrame frame)
          Construct a HNM datagram.
HnmDatagram(java.io.RandomAccessFile raf, int noiseModel)
          Constructor which pops a datagram from a random access file.
 
Method Summary
 boolean equals(Datagram other)
          Tests if this datagram is equal to another datagram.
 HntmSpeechFrame getFrame()
          Get the sinusoidal speech frame
 int getLength()
          Get the length, in bytes, of the datagram's data field.
 void write(java.io.DataOutput out)
          Write this datagram to a random access file or data output stream.
 
Methods inherited from class marytts.unitselection.data.Datagram
equals, getData, getDuration, setDuration
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frame

public HntmSpeechFrame frame
Constructor Detail

HnmDatagram

public HnmDatagram(long setDuration,
                   HntmSpeechFrame frame)
Construct a HNM datagram.

Parameters:
duration - the duration, in samples, of the data represented by this datagram
frame - the parameters of HNM for a speech frame.

HnmDatagram

public HnmDatagram(java.io.RandomAccessFile raf,
                   int noiseModel)
            throws java.io.IOException,
                   java.io.EOFException
Constructor which pops a datagram from a random access file.

Parameters:
raf - the random access file to pop the datagram from.
Throws:
java.io.IOException
java.io.EOFException

HnmDatagram

public HnmDatagram(java.nio.ByteBuffer bb,
                   int noiseModel)
            throws java.io.IOException,
                   java.io.EOFException
Constructor which pops a datagram from a byte buffer.

Parameters:
bb - the byte buffer to pop the datagram from.
Throws:
java.io.IOException
java.io.EOFException
Method Detail

getLength

public int getLength()
Get the length, in bytes, of the datagram's data field.

Overrides:
getLength in class Datagram
Returns:
a non-negative integer representing the number of bytes in the data field.

getFrame

public HntmSpeechFrame getFrame()
Get the sinusoidal speech frame

Returns:
frame

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Write this datagram to a random access file or data output stream.

Overrides:
write in class Datagram
Parameters:
out - the data output to write to.
Throws:
java.io.IOException - if a write error occurs.

equals

public boolean equals(Datagram other)
Tests if this datagram is equal to another datagram.