Reputation: 2655
I would like to extract loudness of a speech signal from an audio file (WAV). I believe it is a perceived quantity that depends not only on the amplitude of a signal but also the frequencies involved. I found a link that was useful https://github.com/librosa/librosa/issues/463 but I
For 1, I found Parselmouth, a wrapper around Praat to work with, but am unsure on how to proceed after extracting the Intensity and Pitch values by doing so:
snd = parselmouth.Sound(path)
intensity = snd.to_intensity()
pitch = snd.to_pitch()
I have also looked into Pydub and PyAudioAnalysis but couldn't find direct methods of evaluating loudness using those either.
What is a pythonic, package object-oriented way of extracting loudness from a WAV file?
Upvotes: 0
Views: 3771
Reputation: 4629
You could use pyloudnorm:
import soundfile as sf
import pyloudnorm as pyln
data, rate = sf.read("test.wav")
meter = pyln.Meter(rate) #
loudness = meter.integrated_loudness(data)
Upvotes: 3