Port managed client audio and Windows application
.NET port / test (macos-latest) (push) Canceled after 0s
.NET port / test (ubuntu-24.04) (push) Canceled after 0s
.NET port / test (windows-latest) (push) Canceled after 0s
.NET port / cpp-conformance (push) Canceled after 0s

This commit is contained in:
2026-09-16 16:48:06 +02:00
parent 5a226ba543
commit 82ad4c2811
56 changed files with 2304 additions and 250 deletions
+27 -2
View File
@@ -5,7 +5,7 @@ namespace VoiceCat.App;
internal static class Program
{
[STAThread]
private static void Main()
private static int Main(string[] args)
{
// Surface exceptions that WinForms' default message-loop handling would otherwise
// swallow silently (or crash with no visible cause).
@@ -16,12 +16,37 @@ internal static class Program
ApplicationConfiguration.Initialize();
if (args.Contains("--smoke-test"))
{
try
{
using var client = new VoiceCat.Interop.VoiceCatClient("Smoke", "test");
using var form = new MainForm(client, 0, "Smoke", "Managed core");
form.CreateControl();
if (form.Controls.Count == 0 || string.IsNullOrEmpty(form.Text)) return 1;
client.PumpEvents();
if (args.Contains("--audio"))
{
var backend = new Audio.WasapiAudioBackend();
using var playback = backend.OpenPlayback();
int samples = 0;
using var capture = backend.OpenCapture(null, false, (pcm, _) => Interlocked.Add(ref samples, pcm.Length));
short[] silence = new short[1920];
for (int i = 0; i < 150; i++) { playback.Write(silence); Thread.Sleep(20); }
if (samples == 0) return 2;
}
return 0;
}
catch { return 1; }
}
using var connectDialog = new ConnectDialog();
var result = connectDialog.ShowDialog();
if (result != DialogResult.OK || connectDialog.ConnectedClient is null)
return;
return 0;
Application.Run(new MainForm(connectDialog.ConnectedClient, connectDialog.SelfUserId,
connectDialog.Nickname, connectDialog.ServerName));
return 0;
}
}