Parselmouthでの音声処理を行う 4.
以前の投稿で, Parselmouthというライブラリについてまとめた. 今回はさらにその音声ファイルの強度(Intensity)の計算コードをまとめておきたい.
ここでも引き続き, 分析するデータは以前作成した「あいうえお」の母音データを対象としている想定である.
# ---------------------------------------------------------
# 強度(Intensity)の計算
# ---------------------------------------------------------
# 音声オブジェクト(snd)から強度プロファイル(時間の経過に伴う音圧の変化)を抽出
intensity = snd.to_intensity()
# 全区間における平均強度を計算(単位: デシベル [dB])
mean_intensity = intensity.get_average()
# 計算結果をコンソールに表示(小数点以下2桁まで)
print(f"4. [平均強度] {mean_intensity:.2f} dB")
参考文献
- Jadoul, Y., Thompson, B., & de Boer, B. (2018). Introducing Parselmouth: A Python interface to Praat. Journal of Phonetics, 71, 1-15. https://doi.org/10.1016/j.wocn.2018.07.001
- Boersma, P., & Weenink, D. (2021). Praat: doing phonetics by computer Computer program. Version 6.1.38, retrieved 2 January 2021 from http://www.praat.org/