Memory backend and multiple instances
Juan Font <[email protected]> Wed, 13 Jun 2012 19:06:43 +0200
| Newsgroups | gmane.comp.lib.openal |
|---|---|
| Message-ID | <CAMQDFK0xMYg8L3x0OH4oBS2=qyhHtd90cj_r0qU0NOVaYtGJNg@mail.gmail.com> |
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 I’ll 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? I’m forgetting some hidden and magical OpenAL functionality? Thanks! Juan Font University of A Coruña _______________________________________________ Openal mailing list [email protected] http://opensource.creative.com/mailman/listinfo/openal