2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.voice.picotts.internal;
15 import java.util.Locale;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.voice.Voice;
21 * Implementation of the Voice interface for PicoTTS
23 * @author Florian Schmidt - Initial Contribution
26 public class PicoTTSVoice implements Voice {
27 private final String languageTag;
29 public PicoTTSVoice(String languageTag) {
30 this.languageTag = languageTag;
34 public String getUID() {
35 return "picotts:" + languageTag.replaceAll("[^a-zA-Z0-9_]", "");
39 public String getLabel() {
44 public Locale getLocale() {
45 return Locale.forLanguageTag(languageTag);