1

I'm working on an iOS game where we create an OpenAL context on startup which exists for the life of the application. We allocate a pool of OpenAL sources. Each time a map is loaded the sound effects (.wav) are loaded into OpenAL buffers, and then we look for available sources when playing them. The only things that are loaded/unloaded are the buffers themselves.

After running for awhile some sounds just stop working when calling alPlaySource(). A call to alGetError() returns -1? Prior to the alPlaySource() call alGetError() returns 0.

2 Answers2

2

This is probably due to the fact that iOS limits the number of concurrent playing sources to 32.

See also: maximum number of OpenAL sound buffers on iPhone

Community
  • 1
  • 1
dpasca
  • 21
  • 1
  • 4
0

I think this was an extremely subtle memory leak resulting in some weird effects like the above. The code was based on some example code, ie SoundEngine which is known to be buggy and should not be used.

We ended up switching over to FMOD.