我必须从Python中的立体声波形文件中的一个通道读取数据.为此我用scipy.io试了一下:
import scipy.io.wavfile as wf
import numpy
def read(path):
data = wf.read(path)
for frame in data[1]:
data = numpy.append(data, frame[0])
return data
Run Code Online (Sandbox Code Playgroud)
但是这段代码非常慢,特别是如果我必须使用更长的文件.那么有人知道更快的方法吗?我通过使用wave.readframes()来考虑标准波形模块,但帧是如何存储的?