Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: How to increase volume of an audio file?

$
0
0

the reader volume is not telling you how loud the audio is, 1.0 simply means that every sample will be left at an unchanged volume. If you set volume to 2.0, then every sample value will be doubled, (effectively a 3dB increase).

The trouble comes when you come to write them back to a file, because the samples will clip if they are outside the range +/- 1.0. The simplest approach is to hard-limit after boosting the volume. This will clip the very loudest parts of your audio file, but if they are very low level in the first place, you might be able to get a good boost without ever clipping.

The proper solution is to use dynamic range compression, which can be tricky to get your head round at first, as you need to select appropriate attack/release/threshold/ratio and make-up gain parameters for your audio. However, this is one of the most effective ways of getting a good audio level. NAudio does contain a very simple compressor, but it has not yet been reworked into the ISampleProvider interface, something I hope to do for the next version.

Mark


Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>