# Setting the audio driver

**URL:** https://discourse.psychopy.org/t/setting-the-audio-driver/47540
**Category:** Builder
**Created:** [July 22, 2026, 10:56am UTC](https://discourse.psychopy.org/t/setting-the-audio-driver/47540 "2026-07-22T10:56:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![marac](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@marac](https://discourse.psychopy.org/u/marac)
#### Post date: [July 22, 2026, 10:56am UTC](https://discourse.psychopy.org/t/setting-the-audio-driver/47540/1 "2026-07-22T10:56:23Z")

</div>

Hi guys,

I want to minimize the delay of my auditory stimuli while working on fMRI tasks. Do you think setting the PTB to 3 is sufficient and necessary?

from psychopy import prefs  
prefs.hardware[‘audioLib’] = [‘PTB’]  
prefs.hardware[‘audioLatencyMode’] = 3

Thank you!

---

<div class="post-metadata">

### Author: ![TParsons](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/tparsons/32/8301_2.png) [@TParsons](https://discourse.psychopy.org/u/TParsons)
#### Post date: [July 22, 2026, 12:34pm UTC](https://discourse.psychopy.org/t/setting-the-audio-driver/47540/2 "2026-07-22T12:34:54Z")

</div>

It’s hard to give a blanket yes or no; I expect it will reduce latency, but whether that reduction matters will depend on how low your latency already is and how low you need it to be.

What you can do is measure the latency using an Audio Validator Routine. Essentially:

- Setup a sound sensor device in Device Manager (this could be a dedicated device like a Cedrus Riponda, BBTK T-Pad, etc. or you can use a microphone)
- Make sure the device is in range of the speaker you’re playing sounds from (one way to do this is to use an audio splitter to plug the same audio cable going to your speaker directly into the microphone socket on your device/computer)
- Create an Audio Validator Routine in your experiment and select the device you setup
- In your Sound Component, under Testing, choose that validator Routine in the “Validate with…” drop down

Your experiment should now have, in addition to the usual `mySound.started/stopped` columns, columns for `mySound.myValidator.started/stopped` and `mySound.myValidator.startDelay/stopDelay`, which tell you the difference between when PsychoPy _requested_ a sound to play and when your sensor _detected the sound playing_.

By looking at the difference in `startDelay` when running in latency mode 2 vs mode 3, you can make an informed decision on whether latency mode 3 is worth it for your study.

---

<div class="post-metadata">

### Author: ![marac](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@marac](https://discourse.psychopy.org/u/marac)
#### Post date: [July 23, 2026, 9:36am UTC](https://discourse.psychopy.org/t/setting-the-audio-driver/47540/3 "2026-07-23T09:36:29Z")

</div>

Thank you so much! I will try to implement the validator
