我正在尝试使用tksnack来创建一个波形,它可以实时移动到正在播放的声音中。我发现一些示例代码或多或少能满足我的需要。在
#! /usr/bin/env python
from Tkinter import *
from tkSnack import *
root = Tkinter.Tk()
initializeSnack(root)
snd = Sound()
def start():
snd.record()
c = SnackCanvas(height=500, width=1920, bg='white')
c.pack()
c.create_waveform(1,1,sound=snd,width=1920,height=500,pixelspersec=500)
start()
root.mainloop()
不过,这个例子从麦克风接收音频,但我只想给它一个mp3。我该怎么做呢?我试着替代阅读(文件)用于记录()但那没用。在
您也可以使用snackogg包…tksnack在Linux中与libsnack alsa fine一起工作。我不知道吃零食。在
在这里的例子中,录制一首曲目-我把按钮放在你的源上。在
相关问题 更多 >
编程相关推荐