Add preparation state to VoiceRecorder component

This commit is contained in:
Thorsten Sommer 2026-01-18 20:49:17 +01:00
parent ce7a334fef
commit 78f69479a3
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 6 additions and 1 deletions

View File

@ -6,7 +6,7 @@
@if (PreviewFeatures.PRE_SPEECH_TO_TEXT_2026.IsEnabled(this.SettingsManager) && !string.IsNullOrWhiteSpace(this.SettingsManager.ConfigurationData.App.UseTranscriptionProvider))
{
<MudTooltip Text="@this.Tooltip">
@if (this.isTranscribing)
@if (this.isTranscribing || this.isPreparing)
{
<MudProgressCircular Size="Size.Small" Indeterminate="true" Color="Color.Primary"/>
}

View File

@ -41,6 +41,7 @@ public partial class VoiceRecorder : MSGComponentBase
private uint numReceivedChunks;
private bool isRecording;
private bool isPreparing;
private bool isTranscribing;
private FileStream? currentRecordingStream;
private string? currentRecordingPath;
@ -58,6 +59,9 @@ public partial class VoiceRecorder : MSGComponentBase
{
if (toggled)
{
this.isPreparing = true;
this.StateHasChanged();
try
{
// Warm up sound effects:
@ -94,6 +98,7 @@ public partial class VoiceRecorder : MSGComponentBase
this.currentRecordingMimeType = actualMimeType;
this.Logger.LogInformation("Audio recording started with MIME type: '{ActualMimeType}'.", actualMimeType);
this.isPreparing = false;
this.isRecording = true;
}
catch (Exception e)