【发布时间】:2021-02-09 21:39:58
【问题描述】:
我知道我可以通过soxi file.wav 获取信息,例如
Input File : '2.wav'
Channels : 1
Sample Rate : 8000
Precision : 16-bit
Duration : 00:04:14.54 = 2036320 samples ~ 19090.5 CDDA sectors
File Size : 4.07M
Bit Rate : 128k
Sample Encoding: 16-bit Signed Integer PCM
我可以看到它有2036320 samples。但是我如何在 python 中做同样的事情呢?
我通过阅读一些文章尝试过这个,但我不断收到<bound method Wave_read.readframes of <wave.Wave_read instance at...
import wave
audio_file = wave.open(wavfile, 'r')
print(audio_file.readframes)
audio_file.close()
【问题讨论】:
标签: python python-3.x wav