This project has moved and is read-only. For the latest updates, please go here.

How to increase or decrease Gain of a audio track ?

Feb 8, 2013 at 9:38 AM

Can any one tell me if naudo have the option for increasing or decreasing Gain of a wav file? if yes, then let me know how?
Feb 8, 2013 at 1:21 PM

I guess you want to control the playback volume? If you use WaveOut you can easily control it with something like this:
WaveOut.Volume =  20
This would e.g. set a volume of 20%.
Feb 10, 2013 at 5:10 PM
Is it possible to find the gain of a particular wav file...


Feb 13, 2013 at 3:19 PM
a WAV file does not have a "gain". You can examine the value of each individual sample though. Probably the easiest solution is to use AudioFileReader, which has a Volume property which you can use to amplify. (1.0 means leave unchanged). Then to go back to a 16 bit WAV file you use SampleToWaveProvider16 and pass this into WaveFileWriter.CreateWaveFile.