I was interested in presenting auditory stimuli in PsychoPy, but I found posts on these forums suggesting that auditory stimuli can have large delays when comparing the timestamp that PsychoPy claims the auditory stimulus was presented to the actually time the sound was output. Some suggested that this may differ based upon the audio package used (Pyo vs. Pygame). I did not have easy access to an Oscilloscope to do proper testing in my environment, but instead did a quick psychophysics experiment to try to gain some insight.
In order to test this in our lab setup (brand new high end iMacs), I ran 8 subjects on simple RT tasks that required responding as quickly as possible to the onset of a visual or auditory stimulus. The literature shows that simple RT to auditory stimuli should be ~30ms faster than simple RT to visual stimuli. Because simple RT is such a simple cognitive process, variability within subjects is relatively small, so even with a small number of trials I should be able to get an accurate estimate of the . I took this 30ms as ground truth assuming no delay in visual or auditory presentation. I ran a within-subject design where the subjects responded in one block (of 100 trials) to visual stimuli (which should not be influenced by any sound card or sound package delay) and the other block to auditory stimuli (which may be influenced by sound card or sound package delay). 4 subjects did the auditory task with the pygame python package, and the other 4 with the pyo python package.
What I found in this sample is that auditory simple RT with the pygame package was ~20ms slower than visual simple RT (and all 4 subjects had slower auditory than visual RT), but auditory simple RT with the pyo package was ~35ms faster than visual simple RT (and all four subjects had faster auditory than visual RT). This suggests that the pygame package introduces an ~50ms delay in sound presentation in PsychoPy, and the Pyo package seemingly completely eliminates any sound card or sound package delay (as our 35ms faster auditory RT with pyo is very similar to the 30ms others have shown in the literature when using presentation software that ensures no sound card delay). Therefore, running PsychoPy with Pyo appears to eliminate all or virtually all sound card delay in my lab setup.
I don't know how well this result generalizes to other lab setups, but I hope that this will be a useful starting point for others (1) trying to quantify any auditory delay in their PsychoPy setup or (2) trying to decide between using pyo or pygame