1
0

feat: Introduce explicit start, stop, and status commands, including minimum recording duration.

This commit is contained in:
2026-02-28 18:06:15 +01:00
parent 8ec0629e1a
commit a55e599c4f
13 changed files with 234 additions and 283 deletions

View File

@@ -58,6 +58,19 @@ public class TranscriptionOrchestrator : ITranscriptionOrchestrator
Logger.LogDebug("Received STOP command");
var config = _configProvider.LoadConfig();
var startTime = _stateTracker.GetRecordingStartTime();
if (startTime.HasValue)
{
var duration = (DateTime.UtcNow - startTime.Value).TotalMilliseconds;
if (duration < config.MinRecordingDuration)
{
Logger.LogDebug($"Recording duration {duration}ms is less than min {config.MinRecordingDuration}ms. Discarding.");
ProcessAbortAsync();
return;
}
}
_notifications.PlaySound(config.StopSoundPath);
_notifications.Notify("Toak", "Transcribing...");