Page 1 of 1

Replay Gain -> vlc.Volume How?

Posted: 31 Aug 2016 01:36
by mmm777
ActiveX Control.

How convert a value of Replay Gain from a file - to a value volume of vlc control?
For example: Repaly Gain is 6.0 dB (Foobar 2000).
What should I set on VLC.Volume?

Re: Replay Gain -> vlc.Volume How?

Posted: 15 Sep 2016 20:19
by mmm777
For now, my solution is below.
Value of ReplayGainCoefficient is obtained by trial and error.
Now much better than without ReplayGain; but I think this is too simple a way of calculation.

Code: Select all

public static class VolumeUtils { public static double ReplayGainCoefficient = 4.0 public static int DefaultLevel { get { return 100; } } // public static int MaxLevel { get { return 200; } } // public static int MinLevel { get { return 20; } } // public static int CalculateLevelAndReplayGain(double replayGain) { return Math.Min(Math.Max(MinLevel, DefaultLevel + (int)Math.Round((ReplayGainCoefficient * replayGain))), MaxLevel); }