From: GiviMAD Date: Fri, 10 Jun 2022 05:39:01 +0000 (+0200) Subject: [pulseaudio] Fix source format options (#12913) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=798d59b2c572d1f70d0a7f9c5d566193e48a2f94;p=openhab-addons.git [pulseaudio] Fix source format options (#12913) Signed-off-by: Miguel Álvarez --- diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioHandler.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioHandler.java index 676cbc1c8f..a4f48ef0d2 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioHandler.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioHandler.java @@ -482,7 +482,7 @@ public class PulseaudioHandler extends BaseThingHandler { } switch (simpleFormat) { case "u8": - return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, null, 8, 1, + return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_UNSIGNED, null, 8, 1, simpleRate.longValue(), simpleChannels.intValue()); case "s16le": return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, false, 16, 1, @@ -491,16 +491,16 @@ public class PulseaudioHandler extends BaseThingHandler { return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, true, 16, 1, simpleRate.longValue(), simpleChannels.intValue()); case "s24le": - return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_UNSIGNED, false, 24, 1, + return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, false, 24, 1, simpleRate.longValue(), simpleChannels.intValue()); case "s24be": - return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_UNSIGNED, true, 24, 1, + return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, true, 24, 1, simpleRate.longValue(), simpleChannels.intValue()); case "s32le": - return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_UNSIGNED, false, 32, 1, + return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, false, 32, 1, simpleRate.longValue(), simpleChannels.intValue()); case "s32be": - return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_UNSIGNED, true, 32, 1, + return new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, true, 32, 1, simpleRate.longValue(), simpleChannels.intValue()); default: logger.warn("unsupported format {}", simpleFormat); diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/resources/OH-INF/thing/source.xml b/bundles/org.openhab.binding.pulseaudio/src/main/resources/OH-INF/thing/source.xml index 147ec817e8..411363eefb 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/resources/OH-INF/thing/source.xml +++ b/bundles/org.openhab.binding.pulseaudio/src/main/resources/OH-INF/thing/source.xml @@ -54,11 +54,11 @@ s16le true - + - - + +