]> git.basschouten.com Git - openhab-addons.git/blob
2a3291797c5bc03fa51b5db257385fc5836cf3fd
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.googletts.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * Voice service implementation.
20  *
21  * @author Gabor Bicskei - Initial contribution
22  */
23 @NonNullByDefault
24 class GoogleTTSConfig {
25     /**
26      * Access to Google Cloud Platform
27      */
28     public @Nullable String clientId;
29     public @Nullable String clientSecret;
30     public @Nullable String authcode;
31
32     /**
33      * Pitch
34      */
35     public Double pitch = 0d;
36
37     /**
38      * Volume Gain
39      */
40     public Double volumeGainDb = 0d;
41
42     /**
43      * Speaking Rate
44      */
45     public Double speakingRate = 1d;
46
47     /**
48      * Purge cache after configuration changes.
49      */
50     public Boolean purgeCache = Boolean.FALSE;
51
52     @Override
53     public String toString() {
54         return "GoogleTTSConfig{pitch=" + pitch + ", speakingRate=" + speakingRate + ", volumeGainDb=" + volumeGainDb
55                 + ", purgeCache=" + purgeCache + '}';
56     }
57
58     String toConfigString() {
59         return String.format("pitch=%f,speakingRate=%f,volumeGainDb=%f", pitch, speakingRate, volumeGainDb);
60     }
61 }