3

I'm working with data taken from the wav files (i.e. an array of integer values). Is it right to think of max volume of wave as the max value of the values from the wav file? I want to process these values, for example, to scale them down - I guess it will reduce the volume of entire wave. And also one point, can I consider the bit depth of the signal as 100% volume (max possible value of the amplitude)?

5

If you want to be technically accurate, a sound file does not have a volume, it has a level. Volume can only exist when there is an actual speaker producing sound as that has a fixed SPL(sound pressure level). A signal can be played back at any volume provided the speaker is able to produce it at that volume.

Instead, it is referred to as signal level when it is a data file or just level for short. You are sort of correct that the maximum level corresponds to the maximum integer, but it also corresponds to the minimum.

Sound files are made of samples. Samples indicate (roughly as there is some anti-aliasing involved) the position on the waveform at that moment in time for the signal. The integer values are generally signed, so we care about both the min and max. A loud signal will be oscillating between a very large positive value and a very large negative value. This would result in quick and large speaker movements which produce more pressure and louder sound.

You can adjust the gain of the sample by multiplying all the balanced integers by a fixed number though and it will gain appropriately assuming your wave file is using a linear scale for the samples. If not, then you will need to apply some more complicated math to deal with the non-linear scale. Some values would become smaller (larger negative value) and some will become larger (positive values).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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