Add RNNoise
This commit is contained in:
		
							parent
							
								
									94471804d4
								
							
						
					
					
						commit
						f1551d16b1
					
				
					 2 changed files with 47 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -19,6 +19,7 @@ in {
 | 
			
		|||
    ./qutebrowser
 | 
			
		||||
    ./gpg.nix
 | 
			
		||||
    ./rofi.nix
 | 
			
		||||
    ./rnnoise.nix
 | 
			
		||||
  ];
 | 
			
		||||
  # Home Manager needs a bit of information about you and the
 | 
			
		||||
  # paths it should manage.
 | 
			
		||||
| 
						 | 
				
			
			@ -64,6 +65,8 @@ in {
 | 
			
		|||
    imagemagick
 | 
			
		||||
    mpv
 | 
			
		||||
    mpc-cli
 | 
			
		||||
    helvum
 | 
			
		||||
    gimp
 | 
			
		||||
    # pulse_sink
 | 
			
		||||
    #games
 | 
			
		||||
    lutris
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										44
									
								
								user/rnnoise.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								user/rnnoise.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,44 @@
 | 
			
		|||
{ config, pkgs, lib, ... }:
 | 
			
		||||
{
 | 
			
		||||
  # RNNoise is a noise supperssion neural network
 | 
			
		||||
  # Here we use it as a plugin for pipewire to create a virtual microphone
 | 
			
		||||
  config = {
 | 
			
		||||
    home.file = {
 | 
			
		||||
      ".config/pipewire/pipewire.conf.d/99-input-denoising.conf".text = ''
 | 
			
		||||
        context.modules = [
 | 
			
		||||
        {   name = libpipewire-module-filter-chain
 | 
			
		||||
            args = {
 | 
			
		||||
                node.description =  "Noise Canceling source"
 | 
			
		||||
                media.name =  "Noise Canceling source"
 | 
			
		||||
                filter.graph = {
 | 
			
		||||
                    nodes = [
 | 
			
		||||
                        {
 | 
			
		||||
                            type = ladspa
 | 
			
		||||
                            name = rnnoise
 | 
			
		||||
                            plugin = ${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so
 | 
			
		||||
                            label = noise_suppressor_mono
 | 
			
		||||
                            control = {
 | 
			
		||||
                                "VAD Threshold (%)" 95.0
 | 
			
		||||
                                "VAD Grace Period (ms)" 200
 | 
			
		||||
                                "Retroactive VAD Grace (ms)" 100
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
                capture.props = {
 | 
			
		||||
                    node.name =  "capture.rnnoise_source"
 | 
			
		||||
                    node.passive = true
 | 
			
		||||
                    audio.rate = 48000
 | 
			
		||||
                }
 | 
			
		||||
                playback.props = {
 | 
			
		||||
                    node.name =  "rnnoise_source"
 | 
			
		||||
                    media.class = Audio/Source
 | 
			
		||||
                    audio.rate = 48000
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        ]
 | 
			
		||||
      '';
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue