]> git.basschouten.com Git - openhab-addons.git/blob
fac90efcff99b74535ee51139e9489bbb0525e5f
[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.rustpotterks.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * The {@link RustpotterKSConfiguration} class contains fields mapping thing configuration parameters.
20  *
21  * @author Miguel Álvarez - Initial contribution
22  */
23 @NonNullByDefault
24 public class RustpotterKSConfiguration {
25     /**
26      * Configures the detector threshold, is the min score (in range 0. to 1.) to trigger the detection.
27      * Defaults to 0.5.
28      */
29     public float threshold = 0.5f;
30     /**
31      * Configures the detector averaged threshold.
32      * If set to 0 this functionality is disabled.
33      */
34     public float averagedThreshold = 0f;
35     /**
36      * Indicates how to calculate the final score.
37      * Only applies to not trained wakewords.
38      */
39     public String scoreMode = "max";
40     /**
41      * Enables a basic vad detector to discard some execution.
42      */
43     public String vadMode = "";
44     /**
45      * Minimum number of positive scores required to not discard the detection.
46      */
47     public int minScores = 5;
48     /**
49      * Emit detection on min partial scores.
50      */
51     public boolean eager = false;
52     /**
53      * Configures the reference for the comparator used to match the samples.
54      */
55     public float scoreRef = 0.22f;
56     /**
57      * Configures the band-size for the comparator used to match the samples.
58      * Only applies to wakeword references.
59      */
60     public int bandSize = 5;
61     /**
62      * Create wav record on the first partial detections and any other one that surpasses its score.
63      *
64      */
65     public boolean record = false;
66     /**
67      * Enables an audio filter that intent to approximate the volume of the stream to a reference level (RMS of the
68      * samples is used as volume measure).
69      */
70     public boolean gainNormalizer = false;
71     /**
72      * Min gain applied by the gain normalizer filter.
73      */
74     public float minGain = 0.5f;
75     /**
76      * Max gain applied by the gain normalizer filter.
77      */
78     public float maxGain = 1f;
79     /**
80      * Set the RMS reference used by the gain-normalizer to calculate the gain applied. If unset an estimation of the
81      * wakeword level is used.
82      */
83     public @Nullable Float gainRef = null;
84     /**
85      * Enables an audio filter that attenuates frequencies outside the low cutoff and high cutoff range.
86      */
87     public boolean bandPass = false;
88     /**
89      * Low cutoff for the band-pass filter.
90      */
91     public float lowCutoff = 80f;
92     /**
93      * High cutoff for the band-pass filter.
94      */
95     public float highCutoff = 400f;
96 }