[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] cd



I thing this would stop the script.
Is it possible to play it on a background, as the simple CD.play(1) would do?


gen2n  
ICQ 176015287



Bob the Hamster napsal(a):
On Wed, Feb 23, 2005 at 03:31:12PM +0100, gen2n wrote:
  
I tried to play some tracks from my CD using:
for track in 2,5,7:
  CD.play(track)
It doesnt work. It plays only the last one (7), all the previous are 
always interrupted but the next track.
Could it be somehow solved inside pygame without need of threading modul?

Pavel
    

CD.play starts the track playing and then returns instantly. It does not 
wait for the track to finish. You probably want something like this:

  for track in 2,5,7:
    CD.play(track)
    while CD.get_busy():
      time.wait(1000)

Hope that helps!
---
Bob the Hamster