用它的内容创建一个正弦波数组。我播放.wav文件,它听起来像预期的那样。在
现在我打开同一个文件,绘制它,得到一个方波。在
为什么会这样?在
sampling_rate = 44100
def seno(frequency, duration=0.5, sampling_rate=44100.0):
return np.array([np.sin(n * 2 * np.pi * frequency / sampling_rate) for n in xrange(int(duration * sampling_rate))]).reshape(-1, 1)
# Example:
write('ejemplo_seno.wav', sampling_rate, seno(1000))
这就是我创建文件的方式
目前没有回答
相关问题 更多 >
编程相关推荐