File: spectrogram.py

package info (click to toggle)
snack 2.2.9-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,628 kB
  • ctags: 3,536
  • sloc: ansic: 35,290; sh: 8,950; tcl: 1,037; python: 701; makefile: 490
file content (27 lines) | stat: -rwxr-xr-x 556 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /usr/bin/env python

from Tkinter import *
from tkSnack import *

root = Tkinter.Tk()

initializeSnack(root)
snd = Sound()

def stop():
    snd.stop()

def start():
    snd.record()

c = SnackCanvas(height=200, width=400, bg='black')
c.pack()
c.create_spectrogram(1,1,sound=snd,width=400,height=200,pixelspersec=200)

f = Frame()
f.pack()
Button(f, bitmap='snackRecord', fg='red', command=start).pack(side='left')
Button(f, bitmap='snackStop', command=stop).pack(side='left')
Button(f, text='Exit', command=root.quit).pack(side='left')

root.mainloop()