

I must conclude that exclude_monitors is currently the best way to go. Because of that, and the above cross-platform compatibility, I don't want to add all_loopbacks/ default_loopback after all. The problem is, however, that as far as I can tell, Core Audio on macOS does not support loopback devices at all. The only reason I included exclude_monitors at all, is because it was so tremendously useful for testing. The maintenance burden of maintaining several different APIs is horrendous, and not something I want to do. I think it isn't that bad to just have separate functions for windows-specific functionality. From the point of view of SoundCard, however, they are clearly microphones, since you use them to record audio data. I can see that this is confusing, since loopback devices are both, speakers and microphones.

"loopback devices" are actually speakers and not microphones Tl dr: The best solution would be to implement a new _Loopback class that inherits from _Microphone and implement the according default_loopback and all_loopbacks methods.
Audio loopback win 1 code#
A solution to prevent having too much code would be to have the theoretical _Loopback class inherit from the _Microphone class and just change the constructor to enable loopback recording (at least in case of the Windows implementation). This might complicate the code a bit, however it would result in much better consistency across all platforms (not sure if macOS supports this kind of recording). However I think that the optimal solution would be to isolate the "loopback devices" and "monitors" in a different class (much like _Microphone and _Speaker, there would be a separate class named _Loopback). Additionally I think it wouldn't make it simpler, because you would have to differentiate between platforms in the application code. I was thinking in this direction, however it would be a little counter-intuitive due to the naming being a bit backwards, because "loopback devices" are actually speakers and not microphones.
