| | |
Tkinter Sound (Python)
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
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()
Similar Threads
- Displaying .jpg in Tkinter (Python 3.1) (Python)
- Radio button help (using Tkinter with Python) (Python)
- Python/Tkinter and the Web (Python)
- Listbox in Tkinter python (Python)
- Sound with Tkinter (Python)
| Thread Tools | Search this Thread |
alarm assignment avogadro beginner bluetooth character cmd code customdialog cx-freeze data decimals dictionary directory dynamic error examples exe file float font format function generator getvalue gnu graphics gui halp homework http ideas import input ip itunes java leftmouse line linux list lists logging loop maze millimeter module mouse number numbers output parsing path port prime programming projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext slicenotation sqlite ssh stdout string strings sudokusolver table terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode urllib urllib2 variable ventrilo verify vigenere web webservice wikipedia windows wxpython xlib



