[Openal] How to record resulting 3-D audio?

Chris Robinson chris.kcat at gmail.com
Thu Jul 9 12:04:15 PDT 2009


On Thursday 09 July 2009 11:15:54 am Nate Foreman wrote:
> I'm working on 3-D spacial audio application that takes input data from
> several microphones located around a virtual listener, combines the
> sources together, and then streams the resulting audio over a socket to
> a remote client to be played, near real-time, on headphones.
>
> I'm a Nube to OpenAl, and I was wondering if it's possible to "capture"
> the resulting audio (from the combined sources), rather than playing it
> on the default device (i.e. speakers)?

OpenAL itself doesn't have a way to read back the resulting mix of sources. 
Some OpenAL implementations may be able to output to a .wav file, however, and 
some sound cards/OSs can feed the output of the sound device into the input.

> I noticed that there's capture-related stuff in the OpenAl API, but it
> seems to be geared toward microphone input devices.  Is this what I
> should use to record the resulting 3-D audio that normally gets played
> on the system' speakers?

This is one way to do it, if your sound card supports capturing the output, 
yes. If the OpenAL app opens the appropriate capture device for the playback 
device being used, then you can capture what is being played. The downside is 
that it will capture other system sounds that are played, too, and it will 
still play out the speakers.

Another option is, using an implementation like OpenAL Soft, you can configure 
the .wav writer output device to write to a FIFO file, then you can read that 
FIFO file while OpenAL is playing. This, though, has the downside that it 
requires a specific implementation, and it has to be properly configured 
before hand.


More information about the Openal mailing list