Can I determine the percentage of volume increase?

So here’s a sightly unconventional solution:


As previously described, there are different ways of measuring “volume”.

The simplest way is to measure the “peak amplitude”. This is how big, vertically, the waveform is (as shown on the vertical track ruler for the default “Waveform” view). Quite simply, full track height = 100 %. Half track height = 50 %, and so on.
Although this is simple, the down side is that it is not a good representation of how “loud” it sounds.
You could have a very quiet track, with just a single “click” that reaches a high level, in which case the “peak level” measurement will be as high as that click, even though the track sounds very quiet.

Another method that is commonly used is called “RMS” (root mean square). This is a kind of average level, and while not perfect, it is a much better indication of loudness. The main limitation is that it takes no account of frequency. How loud something sounds depends not only on how big the waveform is, but also on the frequency. Extremely low frequencies and extremely high frequencies may be totally inaudible (silent) even if they are at quite a high level. Despite this limitation, an RMS measurement is often good enough for comparing sounds.

Below is a Nyquist script that can be run in the Nyquist Prompt effect (see: Nyquist Prompt - Audacity Manual)
When you apply this script to an audio track, it will produce a simple interface like this:

volume.png
The first control provides an option of “peak level” or “rms level”.
The second control sets the measurement interval and is adjustable from 0.1 seconds to 30 seconds.

When applied, the code will create a label track, with labels at the specified interval. Each label will show the level within that label region as a percentage.

In the case of “Peak level”, the level is a simple percentage of the peak amplitude compared with “full scale” (full track height).
In the case of “RMS level”, the level is the RMS average within the label region, compared with a -12 dB reference level.

Here’s the code:

;version 4
;type analyze
;name "Percent Volume"

;control type "Amplitude as" choice "Peak level,RMS level" 0
;control size "Label interval" float "seconds" 2 0.1 30

(defun add-label (n val)
  (let ((start (* n size))
        (end (* (1+ n) size))
        (channel (if chan chan "")))
    (setf percent
        (if (= type 0)  ;linear
            (* 100 val)
            (* 100 (db-to-linear (+ 12 (linear-to-db val))))))
    (setf pc-str (format nil "~a~a" (round percent) channel))
    (push (list start end pc-str) labels)))

(defun rms-labels (sig)
  ;; Percent relative to -12 dB
  (let ((rms (rms sig rate)))
    (do ((val (snd-fetch rms)(snd-fetch rms))
         (count 0 (1+ count)))
        ((not val))
      (add-label count val)))
  (if chan (setf chan "R")))

(defun peak-labels (sig step)
  ;; Percent relative to full scale
  (let ((peaks (snd-avg sig step step op-peak)))
    (do ((val (snd-fetch peaks)(snd-fetch peaks))
         (count 0 (1+ count)))
        ((not val))
      (add-label count val)))
  (if chan (setf chan "R")))

(setf labels ())
(setf rate (/ size))

(if (arrayp *track*)
    (setf chan "L")
    (setf chan nil))

(case type
  (0 (setf step (truncate (* size *sound-srate*)))
     (multichan-expand #'peak-labels *track* step))
  (1 (multichan-expand #'rms-labels *track*)))

labels

Use a percentage calculator to get accurate values…