With this simple fix, MaryTTS creates the correct wav header for the audio inputstream (audioformat is now assigned before we use it)
Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
// The length of an AudioInputStream is expressed in sample frames, not bytes so readAllBytes() cannot be used.
rawAudio = inputStreamToBytes(inputStream);
this.length = rawAudio.length + 36;
- this.inputStream = new SequenceInputStream(getWavHeaderInputStream(length), new ByteArrayInputStream(rawAudio));
this.audioFormat = audioFormat;
+ this.inputStream = new SequenceInputStream(getWavHeaderInputStream(length), new ByteArrayInputStream(rawAudio));
}
private byte[] inputStreamToBytes(InputStream inputStream) throws IOException {