Hi Shawn,

Maybe try doing the recording in a separate thread:

http://www.python.org/doc/current/library/thread.html

Mick

On Tue, Jan 19, 2010 at 12:57 AM, skizm <shawn.me...@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
> tkSnack.initializeSnack(root)
> c = tkSnack.Sound()
> c.record()
> time.sleep(5) #record for 5 seconds
> c.stop()
>
> 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.
>
> Thank you for your help.
> --
> View this message in context: 
> http://old.nabble.com/tkSnack-record-for-specific-period-of-time-tp27218833p27218833.html
> Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss@python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to