Below is the code to get gain and peak.

TrackGain trackGain = new TrackGain(44100, 16);
foreach (sampleSet in track) {
trackGain.AnalyzeSamples(leftSamples, rightSamples)
double gain = trackGain.GetGain();
double peak = trackGain.GetPeak();

Let's say I get gain of 5.34 and peak of 1.33

How can I determine the volume adjustment that I need to make for that track? A formula to determine would be great.

  • Can you provide a link to the documentation of the software you are using ?
    – audionuma
    Commented Mar 16, 2020 at 16:36

1 Answer 1


Replay Gain recommends a target loudness of 89 dB sound pressure level. So, using an available library like nReplayGain to determine the gain needs to be adjusted to our custom target loudness.

So, if we want to target 92.8 dB we add 3.8 dB to the gain that we computed for our track.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.