[visionegg] Re: pygame.mixer sound output :: latency and platform-specific options

  • From: Christophe Pallier <pallier@xxxxxxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Thu, 17 Nov 2005 08:04:13 +0100

Hello,


1. It looks like sound.play() returns immediately, so I can go ahead and display visual images while the sound is playing, correct?


Yes. See, e.g, some simple code at "http://www.pallier.org/ressources/tpexp3/playsound/playsound.html";.
The third example does not display sound but scans the mouse to record reaction time to sound
.
Yet, I don't know the latency between the call (or the return) to play() and the actual start of the sound. (the above example is a toy example and should not be used for a real experiment without checking the latency)


2. pygame uses the SDL_mixer code, and through a cursory inspection, I can't tell if it then uses PortAudio or some other platform- specific library for audio output. Ideas?

pygame is based on SDL (www.libsdl.org) which can use many different audio drivers (not Portaudio, to my knowledge)
Under Linux, the environment variable SDL_AUDIODRIVER can be used to set to select the audio driver (alsa, esd, artsc,...).
I don't know if the lowlatency driver 'jackit' has been implemented yet..


Best,


Christophe Pallier


====================================== The Vision Egg mailing list Archives: //www.freelists.org/archives/visionegg Website: http://www.visionegg.org/mailinglist.html

Other related posts: