2 * Copyright (c) 2010-2024 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.marytts.internal;
15 import java.util.Locale;
17 import org.openhab.core.voice.Voice;
20 * Implementation of the Voice interface for MaryTTS
22 * @author Kelly Davis - Initial contribution and API
23 * @author Kai Kreuzer - Refactored to updated APIs and moved to openHAB
25 public class MaryTTSVoice implements Voice {
30 private final Locale locale;
35 private final String label;
38 * Constructs a MaryTTS Voice for the passed data
40 * @param locale The Locale of the voice
41 * @param label The label of the voice
43 public MaryTTSVoice(Locale locale, String label) {
49 * Globally unique identifier of the voice.
51 * @return A String uniquely identifying the voice globally
54 public String getUID() {
55 return "marytts:" + label.replaceAll("[^a-zA-Z0-9_]", "");
59 * The voice label, used for GUI's or VUI's
61 * @return The voice label, may not be globally unique
64 public String getLabel() {
72 public Locale getLocale() {