mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 11:41:38 +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))
|
@if (PreviewFeatures.PRE_SPEECH_TO_TEXT_2026.IsEnabled(this.SettingsManager) && !string.IsNullOrWhiteSpace(this.SettingsManager.ConfigurationData.App.UseTranscriptionProvider))
|
||||||
{
|
{
|
||||||
<MudTooltip Text="@this.Tooltip">
|
<MudTooltip Text="@this.Tooltip">
|
||||||
@if (this.isTranscribing)
|
@if (this.isTranscribing || this.isPreparing)
|
||||||
{
|
{
|
||||||
<MudProgressCircular Size="Size.Small" Indeterminate="true" Color="Color.Primary"/>
|
<MudProgressCircular Size="Size.Small" Indeterminate="true" Color="Color.Primary"/>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,6 +41,7 @@ public partial class VoiceRecorder : MSGComponentBase
|
|||||||
|
|
||||||
private uint numReceivedChunks;
|
private uint numReceivedChunks;
|
||||||
private bool isRecording;
|
private bool isRecording;
|
||||||
|
private bool isPreparing;
|
||||||
private bool isTranscribing;
|
private bool isTranscribing;
|
||||||
private FileStream? currentRecordingStream;
|
private FileStream? currentRecordingStream;
|
||||||
private string? currentRecordingPath;
|
private string? currentRecordingPath;
|
||||||
@ -58,6 +59,9 @@ public partial class VoiceRecorder : MSGComponentBase
|
|||||||
{
|
{
|
||||||
if (toggled)
|
if (toggled)
|
||||||
{
|
{
|
||||||
|
this.isPreparing = true;
|
||||||
|
this.StateHasChanged();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Warm up sound effects:
|
// Warm up sound effects:
|
||||||
@ -94,6 +98,7 @@ public partial class VoiceRecorder : MSGComponentBase
|
|||||||
this.currentRecordingMimeType = actualMimeType;
|
this.currentRecordingMimeType = actualMimeType;
|
||||||
|
|
||||||
this.Logger.LogInformation("Audio recording started with MIME type: '{ActualMimeType}'.", actualMimeType);
|
this.Logger.LogInformation("Audio recording started with MIME type: '{ActualMimeType}'.", actualMimeType);
|
||||||
|
this.isPreparing = false;
|
||||||
this.isRecording = true;
|
this.isRecording = true;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user