kmonsoor / pyglet

Automatically exported from code.google.com/p/pyglet
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

EOS_PAUSE bug #745

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
On latest master, Ubuntu 14.04.

There appears to be a bug in how Pyglet handles EOS. Using this bit of code 
(where "noise.wav" is just 1 second of noise):

from time import sleep
from pyglet.media import Player, load
noise = load('noise.wav', streaming=False)
x = Player()
x.eos_action = Player.EOS_PAUSE
x.queue(noise)
x.play()
sleep(0.5)
print(x.playing)
x.pause()
x.seek(0)
sleep(0.5)
x.play()

As expected, I get 500 ms noise, an terminal output of "True" (x.playing), 500 
ms silence, then 1000 ms noise. However, if I change the first "sleep" call to 
be 1.5 seconds (i.e., longer than the sound), then I get 1000 ms noise, an 
output of "True" (even though by that point the stream should have been 
paused), and then silence -- the second play() doesn't cause any output. So I 
think somehow "EOS_PAUSE" is not actually effectively calling "x.pause()" (or 
doing the equivalent under the hood) as it should be.

If this makes sense, I can try to take a look at the Pyglet sound code to see 
if I can figure out why this is happening, but that code still confuses me a 
bit...

Original issue reported on code.google.com by larson.e...@gmail.com on 21 May 2014 at 6:58

GoogleCodeExporter commented 9 years ago
In case you want the noise sample:

http://faculty.washington.edu/larsoner/noise.wav

Original comment by larson.e...@gmail.com on 21 May 2014 at 6:59

GoogleCodeExporter commented 9 years ago
Could it be related to this? 
https://code.google.com/p/pyglet/issues/detail?id=651

Original comment by useboxnet on 22 May 2014 at 5:06

GoogleCodeExporter commented 9 years ago
I just commented on that bug -- I can't load the given sample to test it.

Original comment by larson.e...@gmail.com on 22 May 2014 at 5:29