[solved] Temporal Jitter in auditory stimuli presentation with pyaudio
I'm preparing an experiment with sequences of four audio stimuli at 200ms each. So, each sequence has a duration 4x200ms = 800ms. At first I used a sampler item specifying the sound file: [sound1].wav, where "sound1" is the first column in my experiment loop. The result was fine but after reading in the documentation that is preferable to use pyaudio ("if you require very accurate temporal precision when presenting auditory stimuli you may want to write an inline_script that plays back sound using a different module, such as PyAudio.") I decided to change the implementation. So I followed the example presented here: http://people.csail.mit.edu/hubert/pyaudio/. I used the "play" example and I changed only this part to fit my experiment:
# inline_script item OUTPUT_FILE = "/Users/test/Documents/OpenSesame/SESSION_B_2.opensesame/pool/%s.wav" % self.get('sound1') wf = wave.open(OUTPUT_FILE, 'rb')
Once I finished the implementation and I run the experiment, there was definitely a noticeable delay in the stimuli presentation.
I chose pyaudio to avoid any temporal jitter and finally the result was worse. Is there something wrong with my implementation? Thank you very much!