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.) to trigger the detection.
29 public float threshold = 0.5f;
31 * Configures the detector averaged threshold.
32 * If set to 0 this functionality is disabled.
34 public float averagedThreshold = 0f;
36 * Indicates how to calculate the final score.
37 * Only applies to not trained wakewords.
39 public String scoreMode = "max";
41 * Enables a basic vad detector to discard some execution.
43 public String vadMode = "";
45 * Minimum number of positive scores required to not discard the detection.
47 public int minScores = 5;
49 * Emit detection on min partial scores.
51 public boolean eager = false;
53 * Configures the reference for the comparator used to match the samples.
55 public float scoreRef = 0.22f;
57 * Configures the band-size for the comparator used to match the samples.
58 * Only applies to wakeword references.
60 public int bandSize = 5;
62 * Create wav record on the first partial detections and any other one that surpasses its score.
65 public boolean record = false;
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).
70 public boolean gainNormalizer = false;
72 * Min gain applied by the gain normalizer filter.
74 public float minGain = 0.5f;
76 * Max gain applied by the gain normalizer filter.
78 public float maxGain = 1f;
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.
83 public @Nullable Float gainRef = null;
85 * Enables an audio filter that attenuates frequencies outside the low cutoff and high cutoff range.
87 public boolean bandPass = false;
89 * Low cutoff for the band-pass filter.
91 public float lowCutoff = 80f;
93 * High cutoff for the band-pass filter.
95 public float highCutoff = 400f;