Skip to content

Commit 2bba33b

Browse files
committed
voice: Update thresholds for voice detection and command recognition
Adjusted the audio energy threshold, confidence threshold, and command cooldown period to improve voice command detection accuracy and reduce false triggers. Signed-off-by: Chiho Sin <chihosin@icloud.com>
1 parent a68edee commit 2bba33b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/modules/VoiceCommandModule.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ class VoiceCommandModule : private concurrency::OSThread
2828
const int DETECTION_WINDOW_SLICES = 2; // 2 slices = 500ms, 4 slices = 1 second
2929

3030
// Audio energy threshold for voice activity detection (RMS normalized)
31-
const float ENERGY_THRESHOLD = 0.001f; // Lower threshold to avoid missing commands
31+
const float ENERGY_THRESHOLD = 0.002f; // Lower threshold to avoid missing commands
3232

3333
// Confidence threshold for command recognition (compensated for shorter window)
34-
const float CONFIDENCE_THRESHOLD = 0.82f; // 80% threshold compensates for reduced data
34+
const float CONFIDENCE_THRESHOLD = 0.88f; // 80% threshold compensates for reduced data
3535

3636
// Cooldown period to prevent duplicate triggers from sliding window overlap
37-
const uint32_t COMMAND_COOLDOWN = 600; // 600ms (2 slices × 250ms × 2x margin)
37+
const uint32_t COMMAND_COOLDOWN = 850; // 600ms (2 slices × 250ms × 2x margin)
3838

3939
// === Runtime State ===
4040
bool firstTime = true;

0 commit comments

Comments
 (0)