I am writing a program in Python to play audio on a Focusrite Scarlett 6i6 while simultaneous recording another waveform on a Picoscope 2205AMSO. To play audio on the Focusrite, I am using the sounddevice library:
sounddevice.play(noise, blocking=True)
To record the other waveform, I am using the picoscope library:
ps.runBlock()
ps.waitReady()
dataA = ps.getDataV('A', nSamples, returnOverflow=False)
However, these two statements won't run at the same time because they are blocking. If I remove the "blocking = True" argument from the sounddevice.play function call, then it never plays the audio. Is there a way that I can both record and play without blocking?