The calculation of the Replay Gain is explained in detail here. A function to calculate it, written in MATLAB is available here. C Source code and DOS executables are available here. If you can help, the project needs support for other platforms, and a graphical user interface.
The "Radio" and "Audiophile" Replay Gain adjustments and the Peak Amplitude need to be stored in the header of the audio file. Are you one of the authors of Monkey's Audio, MPEG plus, Lame, Ogg Vorbis, ID3v2 etc etc? Can you find room for 8 bytes of information in the header of your files?
The Replay Gain is little use if players don't support it. Can you program a Winamp plug-in? Are you the author of an audio player? See Player Requirements for what's needed, and please get in touch.
All are welcome!