[Openal] Memory backend and multiple instances
juanfontalonso at gmail.com
Wed Jun 13 10:06:43 PDT 2012
I'm trying to create a... well, I don't really know how it is called what
I'm trying to create. The thing is: I want to "render" audio from the same
process (and different sources) to different (runtime-defined, may be more
than 100) memory buffers. At the same time. With different audio parameters
(frequency, number of channels,...).
To start, I think I should write is a backend (based on the current wave
backend, probably) which is able to output to a memory address. The problem
is how I code the multiple output functionality.
At this moment, I have two possible approaches:
a) To Create many instances of the same backend. The way I would implement
the different-memory-output-buffer functionality is by passing/hiding a
pointer to a struct that would encapsulate the required information
(frequency, number of channels, a pointer to the buffer where I want the
audio to be copied in) in the place of the ALCchar* at
backend_open_playback(ALCdevice *device, ALCchar* struct). Yes. It's dirty.
Very dirty. And I’ll have problems when working from the same thread
b) To Create a single instance of the backend. Create multiple ALContext's,
extending the information they store in order to define parameters like
frequency, nb channels and, of course, the memory address where the mixture
of the audio buffers from that context should be copied in.
Which option do you think is cleaner? I’m forgetting some hidden and
magical OpenAL functionality?
University of A Coruña
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Openal