When you use the play function, pyglet creates a new player and loads the
sound in to it. However, Streaming is enabled by default and streamed
sounds generally can only be assigned to one player at a time, so you won't
be able to assign the sound to another player without loading it again or
purging the original player. To solve this, just disable streaming when you
load the audio file:
self.soundtrack = pyglet.resource.media('choice.wav',streaming=False)
@self.window.event
def on_key_press(symbol,modifiers):
self.soundtrack.play()
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.