您也可以使用snackogg包…tksnack在Linux中与libsnack alsa fine一起工作。我不知道吃零食。在
在这里的例子中,录制一首曲目-我把按钮放在你的源上。在#! /usr/bin/env python
from Tkinter import *
from tkSnack import *
root = Tkinter.Tk()
root.geometry("650x560+100+80")
initializeSnack(root)
snd = Sound()
def start():
snd.record()
def stop():
snd.stop()
def play():
snd.play()
def save():
file = root.tk.call('eval', 'snack::getSaveFile')
snd.write(file)
c = SnackCanvas(height=500, width=820, bg='white')
c.pack()
c.create_waveform(1,1,sound=snd,width=1920,height=500,pixelspersec=500)
record=Button(root,width=50,height=50,fg='red', bitmap='snackRecord',command=start).place(x=5,y=501)
stop=Button(root,width=50,height=50,fg='black', bitmap='snackStop',command=stop).place(x=60,y=501)
play=Button(root,width=50,height=50,fg='black', bitmap='snackPlay', command=play).place(x=115,y=501)
save=Button(root,width=5,height=3,fg='black', text='Save', command=save).place(x=170,y=501)
root.mainloop()