[Openal-devel] OpenAL Soft record output HOW ?

Chris Robinson chris.kcat at gmail.com
Wed Dec 16 16:23:24 PST 2009


On Wednesday 16 December 2009 7:20:55 am Kovács Gergely (Designsoft) wrote:
> Hi all,
> the same question already said a hundred times: how to record the mixed
>  output of OpenAL ?

Hi.

There isn't a way to do this in an API-specified way, currently. However, I'm 
partial to the idea of creating an extension that would make a device you can 
handle like a normal playback device (ie. make a context on it, create sources 
and buffers, etc), but which you can also use the capture functions on. Create 
a device with, eg. alcLoopbackCreateDevice, and internally, it would mix to a 
ring buffer that you capture from.

Unfortunately, the devil is in the details, and certain details of how such a 
device would work need to be ironed out. Eg, does it generate samples in real-
time (44100 samples in one second, at 44.1khz), or as fast as possible (read 
1024 samples, and it'll generate 1024 samples to keep the ringbuffer full). Or 
perhaps it can generate the samples on the fly when you ask to capture them.

> I thought I have it when found OpenAL Soft, but not! Trying on Windows XP
>  with the latest soft_oal.dll from http://kcat.strangesoft.net/openal.html
>  Whatever devices I choose with alcOpenDevice and alcCaptureOpenDevice, it
>  only captures the output sound when I choose the "Wave mix out" in the
>  Windows Recording Control. But then it mixes in other applications' sounds
>  too, so it does not capture the internally mixed data, just the sound card
>  output. Anyway, I "see" the new devices that appear with soft_oal.dll, one
>  for playback and one for capture. Selecting them makes no difference.
>  Also, directly using soft_oal.dll does not help either, it just seems to
>  limit the available devices to these two. alcGetError is clear all the way
>  through.
> Tried with an about one year old soft_oal.dll too and it's the same.

The most you would be able to do with OpenAL Soft is write to a .wav file, 
then use the file however you wish. You can create Windows' equivalent of a 
FIFO file, tell OpenAL Soft to write to it, then have your app read it 
asynchronously (making sure to ignore certain size fields that wouldn't be 
filled in until the end).



More information about the Openal-devel mailing list