feat: Introduce explicit start, stop, and status commands, including minimum recording duration.
This commit is contained in:
@@ -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...");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user