I have no idea why it should lag, but it did lag on me as well, so I decided to use pymedia for the music playback. You can make your own threaded class for music playback and use it instead of the normal media.Play()
2011/5/27 pyglet <[email protected]>: > Hello, > > I am new using pyglet with python processing. I am making a quiz game > project for school and am almost done but there is a a problem with > the background music in my quiz game program. Although there are no > problems with my .wav file when you play it through windows media > player, it lags and gives some static when I run python. Another issue > is that when I change the pages of th quiz the program lags, and the > music lags with it, sounding like a scratched record. > > This is a sample of the program that I am using. [Full code here: > http://pastie.org/1981722] > > player = media.Player() > source = media.load("Music/MySecret.wav") > player.queue(source) > player.play() > > I also have tried using this code: > > from pyglet.media import StaticSource, load > BackgroundMusic3 = StaticSource (load("Music/MySecret2.mp3", > streaming=False)) > > def setup(): > > size(1300,580) > BackgroundMusic3.play() > > Any help is greatly appreciated. Thank you in advance, > > Lantsford Lawliet > > -- > You received this message because you are subscribed to the Google Groups > "pyglet-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/pyglet-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
