Pergunta

I'm new to Open AL.
In my iOS application, I've to play multiple audio files (parallel) which are basically animal/bird sounds of duration 2 to 3 seconds only.
In my view, I've different animal buttons. User can tap a button and that animal sound will be played in a loop continuously until user taps the same button again to stop it.
In Open AL, I can have one source and multiple buffers or multiple sources with one buffer each. For my requirement to dyanamically add/remove sounds, which one is good: Whether to "create multiple sources" or "one source and multiple buffers".
Which option will be the optimized solution. Can some one guide me about this please?

Foi útil?

Solução

If you want to be able to have one animal sound play while another one is already playing, you will need multiple sources. If you want to be able to play multiple animal sounds without a delayed playback while it loads from disk, you need multiple buffers.

However, having lots of buffers takes up memory, so you may need to compromise if you run out of memory (have the same number of sources, but less buffers, and do some kind of dynamic loading to incur less of a feeling of delay on the user's part).

That said, start off simple: 1 source, 1 buffer per animal sound. If they're short, you're not likely to run out of memory so optimization will be unnecessary.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top