Reputation: 1959
I'm creating a program to help me out with some bulk-wav conversion (since I often have to convert files to specific sample rates). And what I always have been before when converting is to lower the volume to 85% of the normal (to avoid clipping). But now with NAudio I can't seem to understand how I should do this.
This is the method I'm using to convert the wav files.
using (var reader = new WaveFileReader(sourceFiles[i]))
{
using (var conversionStream = new WaveFormatConversionStream(newFormat, reader))
{
WaveFileWriter.CreateWaveFile(newPath, conversionStream);
}
}
How would I be able to set the volume?
Upvotes: 0
Views: 63
Reputation: 1959
After some more exploring and looking around I found the NAudio.Wave.VolumeWaveProvider16
class, which does exactly what I want!
Upvotes: 1