Maximum number of source/channels which can play in same time (OpenAL)

Tigzi 101 Jul 26, 2007 at 13:57

All is in the title, i m working with openAL, and i need to know what is the maximum number of sound which can be played in same time.
And i don’t find anything in the documentation.


3 Replies

Please log in or register to post a reply.

Frank_Skilton 101 Jul 26, 2007 at 14:14

Wouldn’t the value be hardware dependent?

TheNut 179 Jul 26, 2007 at 15:58

OpenAL on Windows uses Direct Sound, and since Direct Sound is hardware dependent, so too is OpenAL. ALSA (for Linux) is driver driven so it too is hardware dependent.

I read somewhere that if you wanted to know the maximum number of playable sounds, you need only continually create sources and when OpenAL fails to create one, you have your limit.

If all you’re doing is simple games, you’ll never need to worry about this. For more complex games, you’ll need to reuse your sources on the fly.

Skaldi 101 Aug 19, 2007 at 16:05

OpenAL isn’t using directsound if it isnt told to do by initialising the device.

To create sources until failure is the only way for me too, to determin the max sourcenumber.

But it is HIGHLY recommended to always reuse sources and not to gen sources in real time.

With an intelligent source management you can have 16 sources and you wont ever notice that there are only playing very finite sounds.

In the princip the source management works that way: If needed a source, run through your sources you created once and check if they are playing.
When not, reuse it.

Is there no source free you can have a priority system if the new sound shall be played. For example a source which is far away from the listener and very silent (a bird tweeting on a tree) can be overwritten by the new source which might be an explosion next to you.
After the explosion sound played the bird starts tweeting again due to the priority system (the source occupied by the explosion is now free again).

And to be honest you wont miss the birds tweeting during a battle…. So you wont ever notice this.

But modern hardware enables you to use up to 256 sources. But a sourcemanagement system is alway a big advance. Even when you have many sources to use.

Happy Coding