赞
踩
# -*- coding: utf-8 -*-
#/usr/local/bin/python3
# @Time : 2020/3/7 4:05 PM
# @Author : eric
# @File : get_audio_loudness.py
# @Software: PyCharm
import os
import re
import subprocess
import sys
import csv
'''
说明:
Integrated loudness:
I(整体响度): -26.5 LUFS
Threshold: -37.1 LUFS
Loudness range:
LRA(整体范围): 10.2 LU
Threshold: -49.5 LUFS
LRA low: -36.9 LUFS
LRA high: -26.6 LUFS
mean_volume(平均音量): -32.2 dB
max_volume(最大音量): -18.9 dB
'''
'''
:param '/Users/yy/Documents/test_noise/agc/android_new/test_saopin_32bit.wav'
:return {'I': '-26.5', 'LRA': ' 10.2', 'Threshold': '-49.5', 'LRA_low': '-36.9', 'LRA_high': '-26.6', 'mean_volume': '-32.2', 'max_volume': '-18.9'}
# 音频整体响度/音量获取方法,输出文件
'''
def get_audio_loudness_by_file(audiofile):
lufs_I = r"\s+I:\s+([-+\s]\d+\.\d) LUFS"
lufs_Threshold = r"\s+Threshold:\s+([-+\s]\d+\.\d) LUFS"
lufs_LRA = r"\s+LRA:\s+([-+\s]\d+\.\d) LU"
luss_LRS_low = r"\s+LRA low:\s+([-+\s]\d+\.\d) LUFS"
luss_LRS_high = r"\s+LRA high:\s+([-+\s]\d+\.\d) LUFS"
mean_vo
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。