mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-15 21:21:37 +00:00
Fixed base component
This commit is contained in:
parent
2df9d363c8
commit
21d2de2614
@ -1,7 +1,7 @@
|
|||||||
@using AIStudio.Settings.DataModel
|
@using AIStudio.Settings.DataModel
|
||||||
|
|
||||||
@namespace AIStudio.Components
|
@namespace AIStudio.Components
|
||||||
@inherits ComponentBase
|
@inherits MSGComponentBase
|
||||||
|
|
||||||
@if (PreviewFeatures.PRE_SPEECH_TO_TEXT_2026.IsEnabled(this.SettingsManager))
|
@if (PreviewFeatures.PRE_SPEECH_TO_TEXT_2026.IsEnabled(this.SettingsManager))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
using AIStudio.Settings;
|
|
||||||
using AIStudio.Tools.MIME;
|
using AIStudio.Tools.MIME;
|
||||||
using AIStudio.Tools.Services;
|
using AIStudio.Tools.Services;
|
||||||
|
|
||||||
@ -6,7 +5,7 @@ using Microsoft.AspNetCore.Components;
|
|||||||
|
|
||||||
namespace AIStudio.Components;
|
namespace AIStudio.Components;
|
||||||
|
|
||||||
public partial class VoiceRecorder : IDisposable
|
public partial class VoiceRecorder : MSGComponentBase
|
||||||
{
|
{
|
||||||
[Inject]
|
[Inject]
|
||||||
private ILogger<VoiceRecorder> Logger { get; init; } = null!;
|
private ILogger<VoiceRecorder> Logger { get; init; } = null!;
|
||||||
@ -17,9 +16,6 @@ public partial class VoiceRecorder : IDisposable
|
|||||||
[Inject]
|
[Inject]
|
||||||
private RustService RustService { get; init; } = null!;
|
private RustService RustService { get; init; } = null!;
|
||||||
|
|
||||||
[Inject]
|
|
||||||
private SettingsManager SettingsManager { get; set; } = null!;
|
|
||||||
|
|
||||||
private bool isRecording;
|
private bool isRecording;
|
||||||
private FileStream? currentRecordingStream;
|
private FileStream? currentRecordingStream;
|
||||||
private string? currentRecordingPath;
|
private string? currentRecordingPath;
|
||||||
@ -176,7 +172,9 @@ public partial class VoiceRecorder : IDisposable
|
|||||||
public bool ChangedMimeType { get; init; }
|
public bool ChangedMimeType { get; init; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
#region Overrides of MSGComponentBase
|
||||||
|
|
||||||
|
protected override void DisposeResources()
|
||||||
{
|
{
|
||||||
// Clean up recording resources if still active:
|
// Clean up recording resources if still active:
|
||||||
if (this.currentRecordingStream is not null)
|
if (this.currentRecordingStream is not null)
|
||||||
@ -187,5 +185,8 @@ public partial class VoiceRecorder : IDisposable
|
|||||||
|
|
||||||
this.dotNetReference?.Dispose();
|
this.dotNetReference?.Dispose();
|
||||||
this.dotNetReference = null;
|
this.dotNetReference = null;
|
||||||
|
base.DisposeResources();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user