[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Mixer latency



I am getting similar results between using the keyboard and using a drum stick via the actual module, so I think that in this case, its relatively accurate. The real test will not be using some metric - it will be playing a song on the drums, and seeing if it sounds right 8-) The 10ms minimum I came up with earlier is just an estimate of what I think will be acceptable.

Anyway, thanks for the program - once I get home from work I will give it a shot.

Cheers

Brian Fisher wrote:
That's a fascinating way to measure the latency - however it may not
be a good way to measure pygame mixer's own latency specifically (it's
really odd if you can't see a difference with different mixer buffer
settings). If you believe "gamer keyboard" sales people marketing,
depending on the hardware keyboards can have latencies up to like
100ms all on there own.
http://www.pcmag.com/article2/0,1759,1908876,00.asp

Also, I wonder what results the same test would give using something
other than pygame to play the sound?  here's some code on the mac that
may be able to do that:
-------------------
   from AppKit import NSSound

  class MacSound:
     def __init__(self, filepath):
       self._sound = NSSound.alloc()
       self._sound.initWithContentsOfFile_byReference_(filepath, True)
     def play(self): self._sound.play()
     def stop(self): self._sound.stop()
     def is_playing(self): return self._sound.isPlaying()
--------------------
that way you'd have some other data point for comparison.


On Sun, Mar 30, 2008 at 9:26 PM, Wyatt Olson <wyatt.olson@xxxxxxxxx> wrote:
 Once the application starts, type "0:1023" (without quotes), and hit
 enter.  A drum sound will play.  I am measuring latency by recording the
 whole thing in an audio recorder, and measuring the difference in time
 between the sound of me hitting enter and the sound of the sample being
 played.  In my tests, it seems to average to about 65 or 70 ms, with a
 maximum of about 100ms.


Attachment: signature.asc
Description: OpenPGP digital signature