修复 vad目录异常问题 silero_vad.onnx

This commit is contained in:
小肥羊 2024-11-26 09:56:17 +08:00
parent 8e0cc81283
commit 3e936e71f6
5 changed files with 27 additions and 4 deletions

View File

@ -51,7 +51,7 @@ namespace Learn.VideoAnalysis.Components.Pages
NotificationType = NotificationType.Warning
});
}
if (InputAccount == "admin" && InputPassword == "q1w2e3!@#")
if (InputAccount ==AppCommon.Config.Admin.Account && InputPassword == AppCommon.Config.Admin.Password)
{
await session.SetAsync("Login", true);
NavigationManager.NavigateTo("/");

View File

@ -43,7 +43,8 @@ namespace Learn.VideoAnalysis.Controllers.Dto
public TextValue(float v)
{
var s = TimeSpan.FromSeconds((double)v);
Text = s.ToString(@"mm\:ss");
var td = new[] { s.Hours, s.Minutes, s.Seconds };
Text = string.Join(':', td.Where(s => s > 0));
Value = v;
}
public TextValue(string t,object v)

View File

@ -7,7 +7,11 @@
},
"AllowedHosts": "*",
"AppConfig": {
"ID": "APP0001",//
"ID": "APP0001", //
"Admin": {
"Account": "admin",
"Password": "q1w2e3!@#"
},
"Redis": {
"ConnectionString": "127.0.0.1:6379,password=Woshiren123,defaultDatabase=10"
},

View File

@ -69,7 +69,7 @@ namespace VideoAnalysisCore.AICore.SherpaOnnx
OR = new OfflineRecognizer(config);
VADModelConfig = new VadModelConfig();
VADModelConfig.SileroVad.Model = Path.Combine(AppCommon.AIModelFile, "sherpa-onnx-sense-voice-24-07-17", "silero_VAD.onnx");
VADModelConfig.SileroVad.Model = Path.Combine(AppCommon.AIModelFile, "sherpa-onnx-sense-voice-24-07-17", "silero_vad.onnx");
VADModelConfig.Debug = 0;
//缓冲区大小
VAD = new VoiceActivityDetector(VADModelConfig, 60);

View File

@ -272,6 +272,20 @@ namespace VideoAnalysisCore.Common
}
/// <summary>
/// 管理界面Admin账号
/// </summary>
public class AdminConfig
{
/// <summary>
/// 账号
/// </summary>
public string Account { get; set; } = string.Empty;
/// <summary>
/// 密码
/// </summary>
public string Password { get; set; } = string.Empty;
}
/// <summary>
/// redis配置
/// </summary>
public class RedisConfig
@ -308,6 +322,10 @@ namespace VideoAnalysisCore.Common
/// </summary>
public string ID { get; set; } = string.Empty;
/// <summary>
/// Admin
/// </summary>
public AdminConfig Admin { get; set; } = new AdminConfig();
/// <summary>
/// redis
/// </summary>
public RedisConfig Redis { get; set; } = new RedisConfig();