Package com.sun.speech.freetts.util

# Class WaveUtils

java.lang.Object
com.sun.speech.freetts.util.WaveUtils

public class WaveUtils extends Object
Provides a set of utilities for prrocessing wave/audio data.

## Constructor Summary

Constructors
Constructor
Description
`WaveUtils()`

## Method Summary

Modifier and Type
Method
Description
`static final short`
`bytesToShort(byte hiByte, byte loByte)`
Reconstructs a short from its hi and low bytes.
`static void`
`main(String[] args)`
Provides test program for method ulawToShort().
`static final byte`
`shortToUlaw(short sampleData)`
Converts a raw short to ulaw.
`static final short`
`ulawToShort(short uByte)`
Converts from ulaw to 16 bit linear.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### WaveUtils

public WaveUtils()

## Method Details

### shortToUlaw

public static final byte shortToUlaw(short sampleData)
Converts a raw short to ulaw.

Parameters:
  `sampleData` - signed 16-bit linear sample
Returns:
  8-bit ulaw sample, normalized

### ulawToShort

public static final short ulawToShort(short uByte)
Converts from ulaw to 16 bit linear.

Craig Reese: IDA/Supercomputing Research Center
29 September 1989

References:
1) CCITT Recommendation G.711 (very difficult to follow)
2) MIL-STD-188-113,"Interoperability and Performance Standards for Analog-to_Digital Conversion Techniques," 17 February 1987

Parameters:
  `uByte` - 8 bit ulaw sample
Returns:
  signed 16 bit linear sample

### bytesToShort

public static final short bytesToShort(byte hiByte, byte loByte)
Reconstructs a short from its hi and low bytes.

Parameters:
  `hiByte` - the high byte
  `loByte` - the low byte
Returns:
  the short value

### main

public static void main(String[] args)
Provides test program for method ulawToShort().

Parameters:
  `args` - not used