filoe / cscore

An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
Other
2.17k stars 450 forks source link

Noise removal #31

Closed postacik closed 8 years ago

postacik commented 8 years ago

Hi,

There is a noise removal filter in Audacity.

Is it possible to apply noise removal filter on a sound file with cscore?

mvkalsbeek commented 8 years ago

I suspect this 'noise removal' is a VST plugin. So implementation of this would include being able to load any VST with CSCore. If this is within the scope of the project is up to @filoe . Maybe this could be implemented as a DMO or DSP 'effect'.

I came up with a few ways to tackle this problem though:

  1. There are libraries for C# like VST.Net which allow you to develop your own VST plugins (might become very interesting in combination with CSCore), or creating your own VST host (for loading plugins). This might enable you to 'load' the desired noise removal/reduction plugin and integrate it into your source chain (never tried it though).
  2. Another way is using a commandline tool to do the desired operation. sox is one of these tools, and it's noise removal algorithm should be similar to the one in Audacity, as explained in this StackExchange answer. Passing the audio file as an argument with System.Diagnostics.Process.Start is relatively easy to implement. This might be the simplest way.
  3. Lastly, and maybe the cleanest (certainly the coolest) way might be to search the web for noise removal algorithms and implementing them on your own, or forking CSCore and add it to the project. In this Audacity wiki is explained how the noise reductions works. The technique boils down to 'spectral noise gating'.

I don't have much experience with CSCore, but I'm trying to understand and work with it for some personal projects, so I might look into this tonight.

postacik commented 8 years ago

Thanks...