I don't know any command line tools for this, but writing a python script using this function is quite simple using scipy libraries.
We can use scipy.io.wavfile to enter the IO file and then calculate the dB values ourselves (note that this will not necessarily be the standard dB value, as this will depend on your speakers and volume settings).
First we get the file:
from scipy.io.wavfile import read samprate, wavdata = read('file.wav')
Then we break the file into pieces, where the number of blocks depends on how accurately you want to measure the volume:
import numpy as np chunks = np.array_split(wavdata, numchunks)
Finally, we calculate the volume of each fragment:
dbs = [20*log10( sqrt(mean(chunk**2)) ) for chunk in chunks]
where dbs now a list of dB values (again, not necessarily true SPL sound levels) for each fragment of your file.
You can also easily split the data differently using overlapping chunks, etc.
References: - scipy.io.wavfile - dB (SPL)
source share