[voice] Make use of Java17 features (#15487)

Use Map/Set/List.of instead of Collections.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich 2023-08-24 06:46:18 +02:00 committed by GitHub
parent 56e7daf898
commit ab135421a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<AudioFormat> audioFormats = Collections.singleton(
new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, false, 16, null, 16000L));
private final Set<AudioFormat> audioFormats = Set
.of(new AudioFormat(AudioFormat.CONTAINER_WAVE, AudioFormat.CODEC_PCM_SIGNED, false, 16, null, 16000L));
@Override
public Set<Voice> getAvailableVoices() {