Python and MP3

klappnase klappnase at web.de
Thu Jun 24 18:08:55 EDT 2004


Rod Stephenson <viking_kiwi at yahoo.poofters.com> wrote in message news:<wkpt7pn2rl.fsf at yahoo.poofters.com>...
(...)
> It might be worth mentioning the snack sound library for Tcl,
> (though the orginator of this thread is after something for
>  wxPython)
> 
> http://www.speech.kth.se/snack/index.html
> 
> 
(...)
> 
> from Tkinter import *
> root=Tk()
> 
> snackScript = '''package require -exact sound 2.2;
> snack::sound s -file "chaconne.mp3";
> s play -block 1
> '''
> 
> root.tk.eval(snackScript)
> 
> 

It's even easier, because snack comes with a python wrapper included:

from Tkinter import *
import tkSnack

root=Tk() 
root.withdraw()#in case you don't want to see a Tk window in your app
tkSnack.initializeSnack()
s=tkSnack.Sound(file="chaconne.mp3")
s.play()

Michael



More information about the Python-list mailing list