[Tkinter-discuss] tkSnack record for specific period of time
shawn.meier at gmail.com
Tue Jan 19 21:08:59 CET 2010
Cool this works, I was working on the threading idea but this is much
simpler. Earlier i had tried the after function but I had it tied to the
frame object instead of the root object which made it not work for some
Thanks a lot for the help!
Michael Lange wrote:
> On Mon, 18 Jan 2010 15:57:06 -0800 (PST)
> skizm <shawn.meier at gmail.com> wrote:
>> I am currently trying to write a code snippet that will record for a
>> set period of time and I have tried a number of methods to do this
>> yet none have worked, the first one I tried is listed below.
>> from Tkinter import *
>> import time
>> root = Tk()
>> import tkSnack
>> c = tkSnack.Sound()
>> time.sleep(5) #record for 5 seconds
>> This produces an apparently empty sound file, I assume that what is
>> going on here is that the sleep command pauses the entire program
>> including what I am trying to record. I am sure that there is some
>> proper way to do this but after searching for quite a while I am at a
>> loss as to what it may be. In addition to the sleep I have tried
>> the .after(...) member function of the master object. I have tried
>> this with a record and stop button and it works fine.
> with this slightly modified example I get the expected 5 second sound
> file; doesn't this work for you ?
> from Tkinter import *
> import tkSnack
> root = Tk()
> c = tkSnack.Sound(file='test.wav')
> root.after(5000, c.stop)
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
View this message in context: http://old.nabble.com/tkSnack-record-for-specific-period-of-time-tp27218833p27231852.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
More information about the Tkinter-discuss