public int Read(float[] buffer, int offset, int count) { int samplesRead = sourceProvider.Read(buffer, offset, count); float val; for (int i = 0, j = offset; i < samplesRead; i++, j++) { val = filtersLow[(i % channels)].Transform(buffer[j]); val = filtersHigh[(i % channels)].Transform(val); sum += Next(val); sum2 += Next2(val); if (sum / 5000 < desactive) { cut = true; } else if (sum2 / 500 > active) { cut = false; } if (cut) { buffer[j] = 0; } else { buffer[j] = val; } } VoIPConnection.Send(buffer, offset, samplesRead); return(samplesRead); }
public static void SetName(InnerPlayerControl __instance, string LFBNFBOLLNN, bool PKGCJHDPPAF) { if (PlayerControl.LocalPlayer == null || ((PlayerInfo)__instance).Name == "") { return; } if (PlayerControl.LocalPlayer == __instance) { MOD.RunLater(() => Process.Lobby(PlayerInfo.All), 2000); } else { Process.PlayerJoin(__instance); } UIVoIP.CreateVoipMark(); VoIPConnection.SetArgs(new ConnectEventArgs { GameCode = Singleton.GameStartManager.GameRoomName.text.Split('\n')[1], GameName = PlayerControl.LocalPlayer.nameText.name, ID = PlayerControl.LocalPlayer.PlayerId }); }
public static void OnDestroy() { VoIP.Stop(); VoIPConnection.Disconnect(); }