search

Home  >  Q&A  >  body text

python - How to express the intensity (loudness) of a piece of speech?

I hope to analyze the intensity (loudness) of the speech through a piece of speech.

Because I am an engineering dog rather than a science dog, and I am an outsider in audio signal analysis. I only briefly looked at FFT, so I feel insecure about my own method of analyzing voice intensity. I hope an expert in this area can provide guidance. Thank you so much! ! !

The following is my process of obtaining voice signal data. The 123.wav voice file comes from the mp3 transcoding synthesized by Baidu, so even if there is noise in this voice, it should be minimal. There is no need to filter it here (even if it is filtered, I don’t know what the filter coefficient should be). I guess there should be no problem at this point?

# -*- coding: utf-8 -*-
import numpy as np
import pylab as pl
import wave
f = wave.open("/home/dyan/123.wav", "rb")
# 读取格式信息
# (nchannels, sampwidth, framerate, nframes, comptype, compname)
params = f.getparams()
nchannels, sampwidth, framerate, nframes = params[:4]
# 读取波形数据
str_data = f.readframes(nframes)
f.close()
wave_data = np.fromstring(str_data, dtype=np.short)
# 在时间轴上画波形图
# 以上nchannels=1, sampwidth=2, framerate=16000
lenth=len(wave_data)
ti=lenth/16000.0
t = np.arange(0, ti, ti/lenth)
pl.plot(t,wave_data)
pl.show()

Waveform chart (time length is about 1.8s)
I hope to notify the intensity of the voice when playing this voice, but obviously the frequency is too fast, not so fast , for example, statistics once every 0.2 seconds may be more appropriate.
I have 2 ideas, but I’m not sure and don’t feel safe:

1、每0.2s求振幅绝对值平均值。
2、每0.2s取振幅绝对值最大值。

I don’t understand audio signal processing, so I have no idea whether one of these two solutions can represent speech intensity. Or should use other methods.

To sum up, 2 questions:

1、这样获取波形数据wav_data是否正确?
2、怎样表达这段语音的强度(响度)?
曾经蜡笔没有小新曾经蜡笔没有小新2755 days ago738

reply all(1)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-18 11:01:32

    Sound is mechanical vibration wave

    Its intensity is the amplitude

    Treble and bass are frequencies

    reply
    0
  • Cancelreply