FFmpeg audio filter pipeline for speech enhancement Using ffmpeg, I'm recording a talk, its audio with a semi-distant microphone. It makes sense to somewhat enhance the speech clarity, reduce background static and environmental noise, etc., in the most generic terms.

What combination of ffmpeg audio filters am I best advised to use to enhance recorded speech?

I'm currently using

highpass-frequency=300,
lowpass-frequency=4000,


as that is the range speaking voice is most prominent in,

bass=frequency=100:gain=-50,
bandreject=frequency=200:width_type=h:width=200,


to additionally attenuate the bass frequencies, and

compand=attacks=.05:decays=.05:points=-90/-90 -70/-90 -15/-15 0/-10:soft-knee=6:volume=-70:gain=10


to apply dynamic range compression and supposedly make the softer passages (above -70dB) louder and the louder ones more even.

I understand digital filters are not magic, but I'm looking for something more from ffmpeg's (or LADSPA's) repertoire to enhance the sound more, make it more resilient to noise, sporadic coughs, perhaps lose the acquired metallic aftersound ...

The Linux command line I'm using to test:

filters='
...above filter lines, in sequence...
'

arecord -q -r 11025 -f s32_le -c 1 -t wav - |
    ffmpeg -f wav -i - -af "$filters" -f wav - |
    aplay
I just came across one article related to the compand command that might be useful (just in case someone looking for help sees this article).

From the article:


  To test this, and my understanding of compand, I added a very simple filter to remove the quiet section of the audio by decreasing their volume dramatically:

ffmpeg -i in.mp3  -filter_complex \
  "compand=attacks=0:points=-30/-900|-20/-20|0/0|20/20" \
  out.wav

  
  attacks=0 means that I wanted to measure absolute volume, not averaging the sound over a short (or long period of time). When the speaker suddenly yells, or talks back and forth with someone off mic, I want the volume adjustment to be immediate. The downside is that you may hear the volume being clamped.
  
  points is the actual volume mapping function, and I’ll walk through it:
  
  I added a mapping of -30/-900, which means that volume below -30db in the original input track gets converted to -900db (completely silent).