From 8bca481fff81e1705bab41225cc0af18f6efbc81 Mon Sep 17 00:00:00 2001 From: GiviMAD Date: Sun, 28 Apr 2024 17:43:49 +0200 Subject: [PATCH] [audio] Fix bitrate calc (#4141) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miguel Álvarez --- .../main/java/org/openhab/core/audio/utils/AudioWaveUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.audio/src/main/java/org/openhab/core/audio/utils/AudioWaveUtils.java b/bundles/org.openhab.core.audio/src/main/java/org/openhab/core/audio/utils/AudioWaveUtils.java index fa4f7d80a..c7052a1c7 100644 --- a/bundles/org.openhab.core.audio/src/main/java/org/openhab/core/audio/utils/AudioWaveUtils.java +++ b/bundles/org.openhab.core.audio/src/main/java/org/openhab/core/audio/utils/AudioWaveUtils.java @@ -64,7 +64,7 @@ public class AudioWaveUtils { } else { codecPCMSignedOrUnsigned = null; } - Integer bitRate = Math.round(format.getFrameRate() * format.getSampleSizeInBits() * format.getChannels()); + Integer bitRate = Math.round(format.getSampleRate() * format.getSampleSizeInBits() * format.getChannels()); Long frequency = Float.valueOf(format.getSampleRate()).longValue(); return new AudioFormat(AudioFormat.CONTAINER_WAVE, codecPCMSignedOrUnsigned, format.isBigEndian(), format.getSampleSizeInBits(), bitRate, frequency, format.getChannels());