0

So I'm more used to Pygame, and I don't want to change the whole program to run on Pyglet, as it plays sounds while Pygame doesn't.

Is there a way to make Pyglet and Pygame work together without the Pygame window minimizing every time Pyglet plays a sound?

Grant Miller
  • 27,532
  • 16
  • 147
  • 165
Anonymous
  • 131
  • 8
  • Welcome to SO. We get these questions quite often, and usually it's because someone is trying to solve a problem by throwing fixes at the problem and hoping for someone to solve the fix on the self created new problem. That is all well and fine in theory, but if you want to solve audio queues in a graphical application - another graphical application is not ideal or even "possible". If for instance it's mp3 files that are the issue, use a library for audio that supports it instead or try this: https://stackoverflow.com/a/20021547/929999. – Torxed Oct 01 '18 at 14:29
  • For future posts, try to include the code relevant to the issue. This will reduce the amount irritation and frustration from both sides of the question (Q and A). But keep it minimal, only the actual bits and pieces that's relevant to the problem *(for instance, how do you load, queue and play the audio + how do you initiate the Pygame and Pyglet windows)*. Otherwise, we will have to create two sets of code bases ourselves, toss it up here and hope that it maybe solves the problem. But the next person that comes along, might not be as lucky. Be thurrow, be detailed and help the next person out – Torxed Oct 01 '18 at 14:34
  • So far the audio libs I've used either don't work or play 1 sound at a time and can't play sounds at the same time which is what i need. Pygame's mixer doesn't play sounds as for me meanwhile pyglet does. So there's no way to make them both work together? – Anonymous Oct 01 '18 at 15:29
  • I still don't see why you can't use a library designed to do this very task? Is this not what you need: https://stackoverflow.com/questions/39298928/play-multiple-sounds-at-the-same-time-in-python – Torxed Oct 01 '18 at 19:37

0 Answers0