I’m surprised I didn’t find any existing topics about this: is there a simple (cross-platform) way to read audio from the system output using Juce’s audio libraries? I imagine it would work with some kind of virtual audio device, but there doesn’t seem to be any built-in Juce way to do it.
In general, I know that it’s possible for an application to do this directly – for example, Open Broadcaster Software has it. I want my app to be able to do it like OBS does, without requiring a third-party utility (such as JACK).
Thanks for any advice, or if this isn’t currently possible with Juce, could I request it as a feature?
No, it isn’t possible for an app to read from other apps or the system audio output directly.
Not sure whether it’s deliberate in the part of OSes to avoid people ripping audio streams, but they certainly don’t provide a way to do it.
The only way is by installing a custom audio driver which other apps can connect to, e.g. SoundFlower. But no, we haven’t got a JUCE driver you could use for that kind of thing.
Here is an open source project for macOS that does it. The downside is it is a kernel extension, and kernel extensions are now required to be signed or users can’t load them. And getting a kernel extension signing key, you need to tell Apple what you are going to do with you extension and why and then wait 6+ months.
Is there any chance that WASAPI loopback recording will be supported? I know there’s no macOS alternative but it would be a useful feature in Windows. It’s for example implemented in Reaper.
Here’s an example implementation with code:
I haven’t found any license mentioned but the general implementation seems to be not to complicated.
My guess is that it will not be supported. It would be a Windows-only feature that would add even more complexity to the WASAPI-implementation in JUCE.
Yeah, sorry for not replying. It’s an understandable FR and not ridiculous, but not being very cross-platform or widely requested it’s not really something we’d prioritise. If it was easy we might consider it, but to figure out a clean, portable way to present this kind of thing and then implement it on the few platforms that support it would involve quite a bit of research.
Bump!
Has the situation evolved this last two years?
I would definitely use this feature if it was available.
(I want to throw audio-out thru speech-reco).
In the meantime I’m trying to implement it with miniaudio library with moderate success. Got the loopback working. But stopping and opening a new device ends up in an infinite “wait for an object” loop. I reckon it might be conflicting with what’s going on with JUCE’s WASAPI back end at that moment.
If anyone is still looking for a solution, I can upload a Projucer project based on the JUCE AudioRecordingDemo with WASAPI Loopback recording implemented using miniaudio library.