Menu

#7 Output.getLeft returns an incorrect result

open
nobody
None
5
2005-12-28
2005-12-28
No

I ran this:

from time import time
from pymedia.audio import sound

snd = sound.Output(8000, 1, sound.AFMT_U8, 0)
t0 = time()
print 'before', snd.getLeft(), '@', 0
snd.play('\0' * 80000)
print 'after', snd.getLeft(), '@', time()-t0

And got this result:

before 0.0 @ 0
after 5.0 @ 0.0

I expected that the sum of the two values in the bottom
line to be 10, because I played 10 seconds' worth of
data (note the AFMT_U8!), but it 5.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB