-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (29 loc) · 1.14 KB
/
Copy pathProgram.cs
File metadata and controls
30 lines (29 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
namespace VoiceCommander;
internal static class Program
{
[STAThread]
private static int Main(string[] args)
{
if (args.Contains("--deep-self-test", StringComparer.OrdinalIgnoreCase))
{
try
{
using var matcher = new DeepTemplateMatcher();
matcher.InitializeAsync().GetAwaiter().GetResult();
if (!matcher.IsAvailable) return 2;
var embedding = matcher.CreateEmbeddingAsync(new float[24000]).GetAwaiter().GetResult();
return embedding.Length > 0 && embedding.All(float.IsFinite) ? 0 : 3;
}
catch { return 4; }
}
using var mutex = new Mutex(true, "VoiceCommander.Hinata.SingleInstance", out var firstInstance);
if (!firstInstance)
{
MessageBox.Show("Voice Commander はすでに起動しています。タスクトレイを確認してください。", "Voice Commander", MessageBoxButtons.OK, MessageBoxIcon.Information);
return 1;
}
ApplicationConfiguration.Initialize();
Application.Run(new MainForm());
return 0;
}
}