Sound duration higher than expected

Hi,

In order to test the presence of a delay during the emission of sounds in my protocol, I ran it with a Black Box Toolkit V2.

I use a Motu M4 sound card for transmission, so the latency is very acceptable (between 7 and 10 ms on average).

However, I observed a very strange phenomenon: the duration of the sound as detected by the Black Box is 20 ms higher than the desired one.

For example, if I present a stimulus with a duration of 50 ms, the duration detected by the Black Box is 70 ms.

This is the case for stimuli generated from Psychopy (tone, white noise) and for .wav stimuli created from Audacity.

Below are the relevant parts of my code:

# Sound generation
burstSound = sound.backend_ptb.SoundPTB('A', secs=0.05, name='burstSound', sampleRate=48000)
burstSound.setVolume(1.0)

# Play sound in each frame section
nextFlip = win.getFutureFlipTime(clock='ptb')
burstSound.play(when=nextFlip)

Do you have any idea what could cause this issue?

Below are the details of my setup
DELL Precision 7560
OS : Windows 10 Pro Build 19044.2130
32 Go RAM
Processor 11th Gen Intel(R) Coreā„¢ i7-11850H
Soundcard Motu M4
PsychoPy version : 2022.2.4 for 64 bits Windows, using Python 3.8

Thanks for your help !

Jessica