Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80681

Re: Synchronizing a sound with a widget change

From Dave Angel <davea@davea.name>
Subject Re: Synchronizing a sound with a widget change
Date 2014-11-13 06:42 -0500
Organization news.gmane.org
References <54648d03$0$1981$426a74cc@news.free.fr> <54648e75$0$12771$426a74cc@news.free.fr> <546490c1$0$2890$426a74cc@news.free.fr>
Newsgroups comp.lang.python
Message-ID <mailman.15773.1415878987.18130.python-list@python.org> (permalink)

Show all headers | View raw


"ast" <nomail@invalid.com> Wrote in message:
> 
> "ast" <nomail@invalid.com> a écrit dans le message de news:54648e75$0$12771$426a74cc@news.free.fr...
>>
>> "ast" <nomail@invalid.com> a écrit dans le message de 
>> news:54648d03$0$1981$426a74cc@news.free.fr...
>>
>>>
>>> I have the idea to run an other thread to emit the sound, but I didn't try yet.
>>> Is it the solution ?
>>>
>>
>> nope, still doesn't work !
>>
> 
>> root.after(1, mybeep)
> 
> 
> with:
> 
> f = Frame(root, width=300, height=300)
> f.pack()
> f.config(bg='Yellow')
> root.after(80, mybeep)
> 
> it works and with:
> 
> f = Frame(root, width=300, height=300)
> f.pack()
> f.config(bg='Yellow')
> root.after(60, mybeep)
> 
> it doesn't work
> 
> I understand that Python takes times to create the root
> window and to color the frame. It the sound arrives
> before the end of the drawing, Python goes to the sound
> emitting,and when finished it goes back to drawing.
> 
> This is annoying
> I would like sometuhing stable if possible
> 

I don't use Windows, but from what I read,  winsound.Beep is a
 blocking call, and therefore must not be used in the main thread
 of a gui environment. 
Once the function is called, no events are
 processed. 


It seems like you need winsound.SND_ASYNC

-- 
DaveA

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Synchronizing a sound with a widget change "ast" <nomail@invalid.com> - 2014-11-13 11:50 +0100
  Re: Synchronizing a sound with a widget change "ast" <nomail@invalid.com> - 2014-11-13 11:56 +0100
    Re: Synchronizing a sound with a widget change "ast" <nomail@invalid.com> - 2014-11-13 12:06 +0100
      Re: Synchronizing a sound with a widget change Dave Angel <davea@davea.name> - 2014-11-13 06:42 -0500
        Re: Synchronizing a sound with a widget change "ast" <nomail@invalid.com> - 2014-11-13 14:25 +0100
  Re: Synchronizing a sound with a widget change "Yimr Zero" <yimr00@gmail.com> - 2014-11-13 22:34 +0800
  Re: Synchronizing a sound with a widget change Dave Angel <davea@davea.name> - 2014-11-13 11:15 -0500

csiph-web