I have been using sd.playrec() to play and record a sine-sweep in a room at the same time. This happens as part of a python script. However, there is a delay between when the recording starts, and when the sine-sweep starts playing. This delay is around 13000 samples, or a quarter of a second at 48kHz. For my purposes, I need the recording and the playing of the audio to be synchronized.
Is there any way around this? Another python package that might do better? A way to solve this delay?
Thanks.