Added NAudio and first voice test

This commit is contained in:
Nick I. A
2022-08-13 00:52:34 +02:00
parent 36de46a2ce
commit 85b028e3e7
7 changed files with 152 additions and 16 deletions

View File

@ -47,6 +47,8 @@ namespace RageCoop.Client
/// </summary>
public Main()
{
Sync.Voice.InitRecording();
Worker = new Worker("RageCoop.Client.Main.Worker", Logger);
try
{
@ -110,6 +112,8 @@ namespace RageCoop.Client
private bool _lastDead;
private void OnTick(object sender, EventArgs e)
{
P= Game.Player.Character;
PlayerPosition=P.ReadPosition();
@ -211,8 +215,23 @@ namespace RageCoop.Client
_lastDead=P.IsDead;
Ticked++;
}
private bool recording = false;
private void OnKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.B)
{
if (!recording)
{
recording = true;
Sync.Voice.StartRecording();
}
else
{
Sync.Voice.StopRecording();
recording = false;
}
}
if (MainChat.Focused)
{
MainChat.OnKeyDown(e.KeyCode);