MTG / essentia

C++ library for audio and music analysis, description and synthesis, including Python bindings
http://essentia.upf.edu
GNU Affero General Public License v3.0
2.81k stars 525 forks source link

Change default behaviour of `silentFrames` (streaming) FrameCutter #1197

Open Bomme opened 2 years ago

Bomme commented 2 years ago

The default behaviour of the FrameCutter algorithm adds noise to silent frames. This can lead to problems with reproducibility and can be unexpected by users since the standard FrameCutter does not have this option.

In the code there is a comment that explains this design choice.

// Adding noise to avoid divisions by zero (in case the user chooses to do so
  // by setting the silentFrames parameter to ADD_NOISE).  The level of such noise
  // is chosen to be -100dB because it will still be detected as a silent frame
  // by essentia::isSilent() and is unhearable by humans

I propose to change the default value of silentFrames to keep. This would be a breaking change of the API though.

dbogdanov commented 2 years ago

This is a way to make noise adder inside FrameCutter deterministic: https://github.com/MTG/essentia/issues/1192#issuecomment-949062652.

palonso commented 2 years ago

I agree with @Bomme. Probably modifying the API behaviour is not that problematic given that the current default is not deterministic. What concerns me more are the extractor algorithms depending on streaming FrameCutter that could produce zero divisions after this change. We should identify those algorithms and explicitly set the add_noise option.