Capturing audio from running process


#1

Hi JuceHeads.

I am writing an audio editor. It has come a long way already, and I am almost able to do with it what I want. I have one big issue left on my list, though, and as the title indicates: I want to record the output of other applications! There are a couple a decent applications out there that can do it, but I want all the stuff I need for producing music (at least the audio editting part) in one handy application. Also, being a software dev, I don’t want to pay for software that could be fun creating myself…

But - capturing audio like this is hard, it seems. There are no easy feet-in-the-door, so I was hoping someone here knew how to use Juce to get what I need. I have no problems recording from the soundcard inputs, but how to parasite on some other process… I dunno. What would be really swell would be some abstracted class that could represent all running (audio-producing) processes, and let the user tap a stream.

Any thoughts? I work on Mac OS X, so if/when I get the time, I may dive into core audio and have a look around.

  • A

#2

Just thinking out loud here but typically this is done by writing a custom audio driver that wraps the available existing audio drivers on the system, and exposes those driver outputs as separate inputs that you can open from your application just like a regular input.

In Juce terms this custom driver would appear as an audio device that you can select (AudioDeviceSelectorComponent, or programatically using AudioDeviceManager), then you could gain access to its inputs the normal Juce way.

Here’s an example of a commercial product that does what you want:

http://software.muzychenko.net/eng/vac.htm

Unfortunately its for Windows. But it serves as an example. Mac might already have a solution.

The RIAA of course wants to discourage these uses of audio devices.

If there is already public source code for doing this on the Net, or if I am hopelessly confused feel free to correct me I don’t know too much about this.


#3

You are not the first person to want to do this :

http://www.hydrogenaudio.org/forums/lofiversion/index.php/t20494.html

Also

http://www.pouet.net/topic.php?which=7804

Let me know what you come up with!!!


#4

Ouch, that sounds… Awfull, actually, as I want to support different audio interfaces and maybe even families of drivers. I had a naive feeling that it could be possible to gain access to the tree of core audio graphs or whatever (obviously not knowing too much about core audio…).

Another solution could be some sort of loopback, that channels system output directly to the input buffers - but that’s probably not possible in user-space. I’ll post if I think of something clever.

Thanks so far!

  • A

#5

On the Mac there’s:

http://code.google.com/p/soundflower/


#6

@ martinrobinson

Execllent suggestion there. It will definetly work for my immediate purpose (tapping other applications) - but further down the line, the platform independency is lost, and I won’t be able to target one specific application to eavesdrop on… It is a good first step though, so I will try that out.

  • A