Discord: Difference between revisions

Frontear (talk | contribs)
improve the troubleshooting format
Add Krisp noise suppression Workaround
Line 105: Line 105:
=== Krisp noise suppression ===
=== Krisp noise suppression ===
The Krisp noise suppression option will not work on NixOS because the Discord binary is patched before installation, and there is a DRM-style integrity check in the Krisp binary which prevents Krisp from working if the Discord binary is modified. See https://github.com/NixOS/nixpkgs/issues/195512 for details.
The Krisp noise suppression option will not work on NixOS because the Discord binary is patched before installation, and there is a DRM-style integrity check in the Krisp binary which prevents Krisp from working if the Discord binary is modified. See https://github.com/NixOS/nixpkgs/issues/195512 for details.
==== Python Script Workaround ====
{{Warning|The usage of such modifications goes against Discord's [https://discord.com/terms Terms of Service] and  Krisp's [https://krisp.ai/terms-of-use/ Terms of Use] and can result in your Discord account being terminated and/or being banned from using Krisp's services!}}
One way to enable Krisp noise suppression is by patching the <code>discord_krisp.node</code> binary to bypass its DRM verification. Below is a Nix configuration that creates a Python script that patches the binary by modifying specific bytes to bypass the license check: <syntaxhighlight lang="nixos">{ pkgs, ... }:
let
  krisp-patcher =
    pkgs.writers.writePython3Bin "krisp-patcher"
      {
        libraries = with pkgs.python3Packages; [
          capstone
          pyelftools
        ];
        flakeIgnore = [
          "E501" # line too long (82 > 79 characters)
          "F403" # 'from module import *' used; unable to detect undefined names
          "F405" # name may be undefined, or defined from star imports: module
        ];
      }
      (
        builtins.readFile (
          pkgs.fetchurl {
            url = "https://pastebin.com/raw/8tQDsMVd";
            sha256 = "sha256-IdXv0MfRG1/1pAAwHLS2+1NESFEz2uXrbSdvU9OvdJ8=";
          }
        )
      );
in
{
  environment.systemPackages = [
    krisp-patcher
  ];
}
</syntaxhighlight>
{{Note|As of version 0.0.76, the script works. But, future versions of Discord may break the script. Therefore, you should not rely on this script for long-term use. For the latest updates and more details, follow https://github.com/NixOS/nixpkgs/issues/195512.}}
After adding this to your Nix configuration and rebuilding, make sure Discord is completely closed, and then run:
<pre>$ krisp-patcher ~/.config/discord/0.0.76/modules/discord_krisp/discord_krisp.node</pre>
Once you restart Discord and join a VC, you should see a sound wave icon to the left of the hangup icon.


=== Text-to-Speech ===
=== Text-to-Speech ===