# Is latency pre-accounted for in 'when' parameter for PsychPortAudio?

**URL:** <https://psychtoolbox.discourse.group/t/is-latency-pre-accounted-for-in-when-parameter-for-psychportaudio/3969>\
**Category:** Programming Help\
**Tags:** audio\
**Created:** [August 11, 2021, 9:04pm UTC](https://psychtoolbox.discourse.group/t/is-latency-pre-accounted-for-in-when-parameter-for-psychportaudio/3969 "2021-08-11T21:04:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrmxn](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jrmxn](https://psychtoolbox.discourse.group/u/jrmxn)\
**Post date:** [August 11, 2021, 9:04pm UTC](https://psychtoolbox.discourse.group/t/is-latency-pre-accounted-for-in-when-parameter-for-psychportaudio/3969/1 "2021-08-11T21:04:20Z")

</div>

Very general question that I couldn’t find an answer to - in the following line (assuming things are working as expected) will the audio start to play at some\_time or at some\_time + latency?

In other words, is the latency measured at initialization already taken into account by the function, or do I need to take it into account manually?

```auto
some_time = GetSecs() + 10;
PsychPortAudio(‘Start’, pahandle, 1, some_time);

```

Assuming it’s accounted for already - but just wanted to make sure.

Thanks -

PTB-3, Xubuntu 20.04/Windows 7, currently no ASIO card, Matlab 2020a

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [August 11, 2021, 10:31pm UTC](https://psychtoolbox.discourse.group/t/is-latency-pre-accounted-for-in-when-parameter-for-psychportaudio/3969/2 "2021-08-11T22:31:14Z")

</div>

Assuming things are working as expected, it is accounted for. The `PsychPortAudio('LatencyBias')` function allows to manually add an additional corrective offset for the case where your soundcard (or its driver) is not good at figuring things out itself.
