From 1136acfc365f357d2df13a263714e8ae0614c4f9 Mon Sep 17 00:00:00 2001 From: yum Date: Sun, 26 Feb 2023 19:42:33 -0800 Subject: Add retainDuration option to CaptureParams This allows users to retain a suffix of the PCM buffer after a VAD segmentation event, reducing some instances of words being lost at the start of the next VAD window. --- Whisper/API/MfStructs.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Whisper/API') diff --git a/Whisper/API/MfStructs.h b/Whisper/API/MfStructs.h index 39255de..c23d633 100644 --- a/Whisper/API/MfStructs.h +++ b/Whisper/API/MfStructs.h @@ -28,6 +28,9 @@ namespace Whisper float maxDuration = 3.0f; float dropStartSilence = 0.25f; float pauseDuration = 0.333f; + // After audio is segmented using VAD, as many as this many seconds of + // audio will be retained as the input to the next transcription window. + float retainDuration = 0.25f; // Flags for the audio capture uint32_t flags = 0; }; -- cgit v1.2.3