How many sounds can SoundManager store ?

compvis

04-07-2009 03:58:39

hi,

My goal is to continuously play sound file when i press and hold a left-mouse (shooting a bullet in my game) like in beach-head game.

my question is: How many sound objects can OgreAL Sound Manager store ?

With my test, it appears that OgreAL Sound Manager only stores less than 100 sound objects ??? then i continuously press and hold the left-mouse, Sound Manager can't play !!!

so which solutions to continuously play sound with OgreAL Sound manager ?

Phobius

04-07-2009 11:47:11

Hi.
First of all, you are correct, there is a 100 sound limit in OgreAL. Actually, by coincidence, I discovered this myself today. Now. There's a slight difference between having a lot of sounds and having a lot of playing sounds. I've dug through the code and, if I'm correct (and I think I am), you can have as many sounds as you want, but you can only have 100 playing at the same time. Does that make a difference to you? If this is an issue, then please recommend an API change and I'll do my best to put it in.

compvis

04-07-2009 11:54:24

hi Phobius,

Thank you so much !

Could you show your solution ? How can i implement multi sound play in my code ?

Thanks

Phobius

04-07-2009 12:11:21

Well, I was actually hoping that, as a user of the library you'd have an API suggestion. I too think this limitation is a bit strange, but in another way, 100 sounds is a lot. But that shouldn't be a reason for me to stop you from doing that, or any user. If a user wants a million sounds, (s)he should get a million sounds regardless of system impact. I am the current maintainer of this library, so I can put this in for you.

Phobius

04-07-2009 12:24:49

Ok, i've implemented it. The SoundManager() constructor now comes in the form of:

SoundManager(const Ogre::String& deviceName = "", int maxNumSources = 100)

So you can optionally specify the maximum number of sounds. This is not checked in yet, please wait for a post on the OgreAL board; that will be there within a few minutes.

compvis

04-07-2009 12:26:40

wow, thank you so much !

Waiting for your update !

Pls inform me !

Thanks,