]> git.basschouten.com Git - openhab-addons.git/blob
83830485daf20fcdd5c3f08b5fba76d015e806cd
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.voice.pollytts.internal;
14
15 import java.util.Locale;
16
17 import org.openhab.core.voice.Voice;
18
19 /**
20  * Implementation of the Voice interface for PollyTTS.
21  *
22  * @author Robert Hillman - Initial contribution
23  */
24 public class PollyTTSVoice implements Voice {
25
26     /**
27      * Voice locale
28      */
29     private final Locale locale;
30
31     /**
32      * Voice label
33      */
34     private final String label;
35
36     /**
37      * Constructs a PollyTTS Voice for the passed data
38      *
39      * @param locale
40      *            The Locale of the voice
41      * @param label
42      *            The label of the voice
43      */
44     public PollyTTSVoice(Locale locale, String label) {
45         this.locale = locale;
46         this.label = label;
47     }
48
49     /**
50      * Globally unique identifier of the voice.
51      *
52      * @return A String uniquely identifying the voice globally
53      */
54     @Override
55     public String getUID() {
56         return "pollytts:" + label;
57     }
58
59     /**
60      * The voice label, used for GUI's or VUI's
61      *
62      * @return The voice label, may not be globally unique
63      */
64     @Override
65     public String getLabel() {
66         return label;
67     }
68
69     /**
70      * {@inheritDoc}
71      */
72     @Override
73     public Locale getLocale() {
74         return locale;
75     }
76 }