Juan Font
2012-06-13 17:06:43 UTC
Hi,
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 Ill have problems when working from the same thread
(getcurrentcontext)...
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? Im forgetting some hidden and
magical OpenAL functionality?
Thanks!
Juan Font
University of A Coruña
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 Ill have problems when working from the same thread
(getcurrentcontext)...
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? Im forgetting some hidden and
magical OpenAL functionality?
Thanks!
Juan Font
University of A Coruña