0

I'm using this program to play na audio file:

music = pyglet.resource.media('file.wav') music.play()

pyglet.app.run()

I have a problem: I can't do anything after this program. How to stop the audio file when is played? It's look like a loop.

Jean-Pierre
  • 225
  • 2
  • 4
  • 7
  • This answer uses SPACE bar to pause/resume video playing: https://stackoverflow.com/a/62506039/1769859 – derek.z Jun 22 '20 at 02:48

1 Answers1

0

I think you'd have to include add an eventlistener for the on_eos event.

For an example have a look as this thread on the pyglet Google group.

Alastair Montgomery
  • 1,756
  • 5
  • 21
  • 44