2 * Copyright (c) 2010-2023 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.rustpotterks.internal;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
19 * The {@link RustpotterKSConfiguration} class contains fields mapping thing configuration parameters.
21 * @author Miguel Álvarez - Initial contribution
24 public class RustpotterKSConfiguration {
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.
29 public float threshold = 0.5f;
31 * Configures the detector averaged threshold, is the min score (in range 0. to 1.) that the audio should obtain
33 * combination of the wake word templates, the detection will be aborted if this is not the case. This way it can
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.
38 public float averagedThreshold = 0.2f;
40 * Indicates how to calculate the final score.
42 public String scoreMode = "max";
44 * Minimum number of positive scores to consider a partial detection as a detection.
46 public int minScores = 5;
48 * Configures the reference for the comparator used to match the samples.
50 public float comparatorRef = 0.22f;
52 * Configures the band-size for the comparator used to match the samples.
54 public int comparatorBandSize = 5;
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).
59 public boolean gainNormalizer = false;
61 * Min gain applied by the gain normalizer filter.
63 public float minGain = 0.5f;
65 * Max gain applied by the gain normalizer filter.
67 public float maxGain = 1f;
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.
72 public @Nullable Float gainRef = null;
74 * Enables an audio filter that attenuates frequencies outside the low cutoff and high cutoff range.
76 public boolean bandPass = false;
78 * Low cutoff for the band-pass filter.
80 public float lowCutoff = 80f;
82 * High cutoff for the band-pass filter.
84 public float highCutoff = 400f;