[marytts] Fix incorrect wav header (#12571)

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>
This commit is contained in:
dalgwen 2022-04-04 08:50:30 +02:00 committed by GitHub
parent 94301eee8c
commit f1a1bd5f1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -57,8 +57,8 @@ class MaryTTSAudioStream extends FixedLengthAudioStream {
// 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 {