It sounds awful, and skips through a good 3:30 track in seconds.

Here's some code to demonstrate:

import pyglet
media = pyglet.media.load("D:\\Music\\[FLAC] Weekender Girl _ fake doll\\01 
. Weekender Girl.flac")
player = pyglet.media.Player()
player.queue(media)
player.eos_action = player.EOS_LOOP
player.play()
player.pause() #Call this after some time.


Here's<http://www.mediafire.com/download/1i291zk1raut57w/01_._Weekender_Girl.flac>a
 file to test it with.

Here's <https://soundcloud.com/asday/herp> what it sounds like.  Headphone 
warning.

I did have a ManagedMediaPlayer() in the first place, but I'm not sure why, 
as I haven't looked at the code in a while, but it did the same thing.

I'm on python 2.7, with pyglet 1.2alpha1, on x64 Win7.

Closest I could find to useful was this 
<http://layer.googlecode.com/svn/layer/layer/audio.py>page, but I don't 
have any _audio properties anywhere, so that didn't help me.  Ctrl+F "FLAC" 
to get to the right line.

Upon some source-diving, and some hints from the above page, I tried to 
change the buffer size of the DirectSound driver, which I assume I'm using; 
being on Windows.  It doesn't seem to get called into being before 
.play()ing the audio, though, and changing the buffer size after that 
yields the lengthy and ugly error:

>>> player.play()
>>> player._audio_player._buffer_size
44800
>>> player._audio_player._buffer_size *= 20
Exception in thread Thread-1:
Traceback (most recent call last):
  File "D:\app\Python27\lib\threading.py", line 551, in __bootstrap_inner
    self.run()
  File "D:\app\Python27\lib\threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "D:\app\Python27\lib\site-packages\pyglet\media\__init__.py", line 
138, in _thread_run
    self.run()
  File 
"D:\app\Python27\lib\site-packages\pyglet\media\drivers\directsound\__init__.py",
 
line 69, in run
    player.refill(write_size)
  File 
"D:\app\Python27\lib\site-packages\pyglet\media\drivers\directsound\__init__.py",
 
line 294, in refill
    self.write(audio_data, length)
  File 
"D:\app\Python27\lib\site-packages\pyglet\media\drivers\directsound\__init__.py",
 
line 367, in write
    ctypes.byref(p1), l1, ctypes.byref(p2), l2, 0)
  File "D:\app\Python27\lib\site-packages\pyglet\com.py", line 125, in 
<lambda>
    self.method.get_field()(self.i, self.name)(obj, *args)
  File "_ctypes/callproc.c", line 936, in GetResult
WindowsError: [Error -2147024809] The parameter is incorrect

-- 
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 http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to