Microphone empty wav Files

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): macOS Sonoma 14.3
PsychoPy version (e.g. 1.84.x): 2024.1.4 and 2023
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?:
I’m trying to record audio from a microphone, but unfortunately, the files are empty. I have made several attempts to solve this issue, such as specifying the duration as 8 seconds when the length of the video is 8, but the problem seems to occur when I connect to the sound card (Scarlett 2i2). If I use the Mac without any sound card, it plays normally through headphones and records audio from the laptop.

I have a similar experiment that uses an audio component instead of a video component, and it works normally. What can be the issue, and how can I solve it?