views:

13

answers:

1

From the OpenAL documentation:

The basic OpenAL objects are a Listener, a Source, and a Buffer. There can be a large number of Buffers, which contain audio data. Each buffer can be attached to one or more Sources

My problem is, that I have one sound file which I need to play multiple times per second, at the same time. The sound is 2 seconds long. So it will overlap.

Would I need multiple filled buffers for this (= multiple times that sound in memory)?

If I would attach one Buffer to multiple Sources, would I be able to play the sound 10 times, overlapping itself, with just one copy in memory? Or would I still have to deal with 10 copies of that sound in memory?

A: 

you can, buffer is independent to source, you can have multiple source pointing to same buffer, by calling alSourcePlay() you play the source not buffer.

how they manage the buffer while playing multiple source pointing to same buffer at the same time is blackbox to programmer, its managed by the openAL driver.

you should notice that openAL buffer is not (always) the same thing as audio data in memory, openAL buffer is implementation dependent by the openAL driver, the data of the buffer could be located in system memory, or sound card memory. so when you call alBuferData you are copying audio data from your memory to openAL managed memory, after that there are no reference or pointer from openAL buffer to your audio data, you can manipulate your audio data without affecting openAL buffer.

uray