I want to capture computer output, run it through a neural network, then play back the audio in real time. So far I have found BlackHole:
import sounddevice as sd
sd.default.device = 'BlackHole 2ch'
This works great for capturing output. The problem is I want to capture the audio with BlackHole, then feed audio back to the speaker output in real time. Setting sd.default.device = "MacBook Pro Speakers does not change the system audio output (it is still going to BlackHole). How can I programmatically change the device audio output?