mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 10:21:36 +00:00
Add preparation state to VoiceRecorder component
This commit is contained in:
parent
ce7a334fef
commit
78f69479a3
@ -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"/>
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user