From: Holger Friedrich Date: Thu, 24 Aug 2023 04:46:18 +0000 (+0200) Subject: [voice] Make use of Java17 features (#15487) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=ab135421a0642a6fbd5b4f444e0ca4bdd67f14bc;p=openhab-addons.git [voice] Make use of Java17 features (#15487) Use Map/Set/List.of instead of Collections. Signed-off-by: Holger Friedrich --- diff --git a/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java b/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java index ecb6a2ebb5..93d149c649 100644 --- a/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java +++ b/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java @@ -12,7 +12,6 @@ */ package org.openhab.voice.picotts.internal; -import java.util.Collections; import java.util.Locale; import java.util.Set; import java.util.stream.Collectors; @@ -49,8 +48,8 @@ public class PicoTTSService extends AbstractCachedTTSService { new PicoTTSVoice("es-ES"), new PicoTTSVoice("fr-FR"), new PicoTTSVoice("it-IT")) .collect(Collectors.toSet()); - private final Set audioFormats = Collections.singleton( - new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, false, 16, null, 16000L)); + private final Set audioFormats = Set + .of(new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, false, 16, null, 16000L)); @Override public Set getAvailableVoices() {