python播放tksnack_tksnack正在尝试创建波形

您也可以使用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()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值