Start New Discussion within our Software Development Community

The module tkSnack from our friends at KTH in Stockholm, Sweden allows you to play a variety of sound files using the Tkinter GUI. Supported sound files are WAV, MP3, AU, SND and AIFF formats.

# using tkSnack to play .wav .mp3 and .au sound files on Tkinter
# needs Python module  tkSnack  developed at KTH in Stockholm, Sweden
# free download: snack229-py.zip or later version
# from: http://www.speech.kth.se/snack/
# on my system I copied tkSnack.py to D:\Python24\Lib and the folder snacklib to D:\Python24\tcl
# tested with Python24      vegaseat      25jun2006

from Tkinter import *
import tkFileDialog
import tkSnack

form1 = Tk()
# have to initialize the sound system
tkSnack.initializeSnack(form1)

def load_play_sound():
    mask_list = [("Sound files","*.wav *.au *.mp3")]
    sound_file = tkFileDialog.askopenfilename(initialdir='', filetypes=mask_list)
    form1.title('...'+sound_file[-15:])
    sound1 = tkSnack.Sound(load=sound_file)
    sound1.play()

label1 = Label(form1, text='   using tkSnack to play .wav .mp3 and .au sound files   ')
label1.pack(side=TOP)
button1 = Button(form1, text=' Load Sound ', command=load_play_sound)
button1.pack(side=TOP)

form1.mainloop()

Does anybody knows how to use py2exe, and include tkSnack ???
I guess there is something with a 'packages' option, but I can't find any documentation.
Thank for your help

The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.