]> git.basschouten.com Git - openhab-addons.git/blob
6f0406f147a69e36c0e235436382007ee47e9dbb
[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.) that some wake word template should
27      * obtain to trigger a detection. Defaults to 0.5.
28      */
29     public float threshold = 0.5f;
30     /**
31      * Configures the detector averaged threshold, is the min score (in range 0. to 1.) that the audio should obtain
32      * against a
33      * combination of the wake word templates, the detection will be aborted if this is not the case. This way it can
34      * prevent to
35      * run the comparison of the current frame against each of the wake word templates which saves cpu.
36      * If set to 0 this functionality is disabled.
37      */
38     public float averagedThreshold = 0.2f;
39     /**
40      * Indicates how to calculate the final score.
41      */
42     public String scoreMode = "max";
43     /**
44      * Minimum number of positive scores to consider a partial detection as a detection.
45      */
46     public int minScores = 5;
47     /**
48      * Configures the reference for the comparator used to match the samples.
49      */
50     public float comparatorRef = 0.22f;
51     /**
52      * Configures the band-size for the comparator used to match the samples.
53      */
54     public int comparatorBandSize = 5;
55     /**
56      * Enables an audio filter that intent to approximate the volume of the stream to a reference level (RMS of the
57      * samples is used as volume measure).
58      */
59     public boolean gainNormalizer = false;
60     /**
61      * Min gain applied by the gain normalizer filter.
62      */
63     public float minGain = 0.5f;
64     /**
65      * Max gain applied by the gain normalizer filter.
66      */
67     public float maxGain = 1f;
68     /**
69      * Set the RMS reference used by the gain-normalizer to calculate the gain applied. If unset an estimation of the
70      * wakeword level is used.
71      */
72     public @Nullable Float gainRef = null;
73     /**
74      * Enables an audio filter that attenuates frequencies outside the low cutoff and high cutoff range.
75      */
76     public boolean bandPass = false;
77     /**
78      * Low cutoff for the band-pass filter.
79      */
80     public float lowCutoff = 80f;
81     /**
82      * High cutoff for the band-pass filter.
83      */
84     public float highCutoff = 400f;
85 }