Pressing noise with PulseAudio

    image
    I often see laptop owners complaining about microphone noise in Linux, while under Windows there are fewer or noises. As a rule, the manufacturer, who installed the cheapest microphone and / or codec possible, is to blame for this, hoping to smooth out the disgusting quality of iron with software.
    Fortunately, Linux has a wonderful PulseAudio audio server, with which you can make the audio from your microphone noticeably better.

    Method # 1

    In order to use the PulseAudio built-in noise and echo cancellation module, which works according to the webrtc or speex algorithm, for a specific program, it is enough to run it with an environment variable:
    PULSE_PROP="filter.want=echo-cancel"

    And all your sound will be magically rid of noise and echo!
    Example:
    PULSE_PROP="filter.want=echo-cancel" skype

    Before:
    image
    After:
    image

    Method # 2

    Create a constant source and sink with noise reduction:
    load-module module-echo-cancel source_name=noechosource sink_name=noechosink
    set-default-source noechosource

    You can add these lines to /etc/pulse/default.pa somewhere at the end so that they are executed every time pulseaudio starts.

    Unfortunately, in the current version of PulseAudio there is a bug due to which this module works only when not only recording but also playback is performed. Say, in Skype, Mumble and other voice phones everything will be wonderful right away, and if you go only to record sound, for example, through audacity, you should include some background music in it, even with a minimum volume.
    If you use the second method, make sure that the program you need plays audio in the sink with noise reduction, and not directly into the audio card. You can transfer a sink, for example, through pavucontrol.
    Do not play music in the audio player through the noise-canceling sink, otherwise you will get sound in mono and 32kHz.

    On habrahabr there is one of PulseAudio developers - AEP . I thank him for the consultation.

    Also popular now: