Class WaveUtils
java.lang.Object
com.ibm.watson.text_to_speech.v1.util.WaveUtils
public final class WaveUtils extends Object
Utility class to write the data size header in wave(.wav) files synthesized with the
TextToSpeech
service.-
Method Summary
Modifier and Type Method Description static InputStream
reWriteWaveHeader(InputStream is)
Re-writes the data size in the header(bytes 4-8) of the WAVE(.wav) input stream.
It needs to be read in order to calculate the size.static byte[]
toByteArray(InputStream is)
Converts anInputStream
to byte array.
-
Method Details
-
reWriteWaveHeader
Re-writes the data size in the header(bytes 4-8) of the WAVE(.wav) input stream.
It needs to be read in order to calculate the size.- Parameters:
is
- the input stream- Returns:
- A new input stream that includes the data header in the header
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
toByteArray
Converts anInputStream
to byte array.- Parameters:
is
- the input stream- Returns:
- the byte array
- Throws:
IOException
- If the first byte cannot be read for any reason other than end of file, or if the input stream has been closed, or if some other I/O error occurs.
-