From f1a1bd5f1d8de3d0e1e9a4831a0d69e68077ace2 Mon Sep 17 00:00:00 2001 From: dalgwen Date: Mon, 4 Apr 2022 08:50:30 +0200 Subject: [PATCH] [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 --- .../org/openhab/voice/marytts/internal/MaryTTSAudioStream.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSAudioStream.java b/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSAudioStream.java index c9815c060..f0b98fc48 100644 --- a/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSAudioStream.java +++ b/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSAudioStream.java @@ -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 {