获取音频信息:
with wave.open(audio_path, "rb") as f:
f = wave.open(audio_path)
print(f.getparams())
----------------------------------
# 返回内容
_wave_params(nchannels=1, sampwidth=2, framerate=16000, nframes=148640, comptype='NONE', compname='not compressed')
nchannels:声道数
sampwidth:采样宽度
framerate:帧速率,8K,16K
nframes:帧数
comptype:唯一标识
compname:无损