Hello,
I am running Ubuntu 14.04
I unstalled the pygame-pyglet package which had a version dated from 2009
an ran 'pip install pyglet' to install a more up to date version of pyglet.
Now, the attached python script crashes when playing audio (while it worked
with the 2009 version of pyglet)
Below is the console's output (with debug_media set to True):
I do not know if it is the origin of the probleme but I noticed the odd
message "Error importing driver directsound: 'module' object has no
attribute 'oledll'" (as I am running under linux).
chrplr@is151214:~/code/testsā« python test-pyglet-0.py
get_audio_data
Got an audio packet at 0.0
Got requested audio packet at 0.0
get_audio_data returning ts 0.000000 with events []
remaining events are []
get_audio_data
Got an audio packet at 0.09288
Got requested audio packet at 0.09288
get_audio_data returning ts 0.092880 with events []
remaining events are []
get_audio_data
Got an audio packet at 0.18576
Got requested audio packet at 0.18576
get_audio_data returning ts 0.185760 with events []
remaining events are []
get_audio_data
Got an audio packet at 0.278639
Got requested audio packet at 0.278639
get_audio_data returning ts 0.278639 with events []
remaining events are []
get_audio_data
Got an audio packet at 0.371519
Got requested audio packet at 0.371519
get_audio_data returning ts 0.371519 with events []
remaining events are []
get_audio_data
Got an audio packet at 0.464399
Got requested audio packet at 0.464399
get_audio_data returning ts 0.464399 with events []
remaining events are []
get_audio_data
Got an audio packet at 0.557279
Got requested audio packet at 0.557279
get_audio_data returning ts 0.557279 with events []
remaining events are []
get_audio_data
Got an audio packet at 0.650159
Got requested audio packet at 0.650159
get_audio_data returning ts 0.650159 with events []
remaining events are []
get_audio_data
Got an audio packet at 1.486077
Got requested audio packet at 1.486077
get_audio_data returning ts 1.486077 with events []
remaining events are []
get_audio_data
Got an audio packet at 1.578957
Got requested audio packet at 1.578957
get_audio_data returning ts 1.578957 with events []
remaining events are []
get_audio_data
Got an audio packet at 1.671837
Got requested audio packet at 1.671837
get_audio_data returning ts 1.671837 with events []
remaining events are []
get_audio_data
Got an audio packet at 1.764717
Got requested audio packet at 1.764717
get_audio_data returning ts 1.764717 with events []
remaining events are []
get_audio_data
Got an audio packet at 1.857596
Got requested audio packet at 1.857596
get_audio_data returning ts 1.857596 with events []
remaining events are []
get_audio_data
get_audio_data returning None
del avbin source
Error importing driver directsound:
'module' object has no attribute 'oledll'
context state cb
context state cb
context state cb
context state cb
Client version: 4.0.0
Server: unix:/run/user/1000/pulse/native
Protocol: 28
Server protocol: 28
Local context: Yes
write callback: 11024 bytes
packet 0.0
Traceback (most recent call last):
File "source/callbacks.c", line 206, in 'calling callback function'
File
"/usr/local/lib/python2.7/dist-packages/pyglet/media/drivers/pulse/__init__.py",
line 357, in _write_cb
pa.pa_free_cb_t(0), # Data is copied
SystemError: NULL result without error in PyObject_Call
stream ready
play
Traceback (most recent call last):
File "test-pyglet-0.py", line 29, in <module>
sound.play()
File "/usr/local/lib/python2.7/dist-packages/pyglet/media/__init__.py",
line 473, in play
player.play()
File "/usr/local/lib/python2.7/dist-packages/pyglet/media/__init__.py",
line 1012, in play
self._set_playing(True)
File "/usr/local/lib/python2.7/dist-packages/pyglet/media/__init__.py",
line 994, in _set_playing
self._audio_player.play()
File
"/usr/local/lib/python2.7/dist-packages/pyglet/media/drivers/pulse/__init__.py",
line 477, in play
pa.pa_stream_success_cb_t(0), None)
SystemError: NULL result without error in PyObject_Call
--
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.
#! /usr/bin/env python
# Time-stamp: <2016-04-24 15:56:07 chrplr>
import pyglet
from pyglet.window import mouse
pyglet.options['debug_media'] = True
window = pyglet.window.Window()
image = pyglet.resource.image('k43G3R8.jpg')
@window.event
def on_draw():
window.clear()
image.blit(0, 0)
@window.event
def on_key_press(symbol, modifiers):
print 'A key was pressed'
@window.event
def on_mouse_press(x, y, button, modifiers):
if button == mouse.LEFT:
print 'The left mouse button was pressed.'
sound = pyglet.resource.media('dog_mono_22050.wav', streaming=False)
sound.play()
pyglet.app.run()