SFML community forums

Help => Audio => Topic started by: nitram_cero on December 31, 2008, 09:12:44 pm

Title: alGenSources fails after creating a bunch of sf::Sounds
Post by: nitram_cero on December 31, 2008, 09:12:44 pm
alGenSources fails after creating 62 sounds in my case.

Apparently OpenAL has a limit on sources, so the relation of 1 sf::Sound to 1 OpenAL-source is not very useful.

Please read this:
http://www.gamedev.net/community/forums/topic.asp?topic_id=102469

Any insight on this? Can OpenAL software-mix sounds as SDL_mixer does when putting them in a channel?

EDIT:
I'm using the OpenAL32.dll included in the SFML sdk and it works now.
I was using before the official OpenAL to solve an SFML 1.3 bug, but with SVN-950 it's solved now, and I've come back to it.
Geez, I hate this incompatible library stuff... only gives headaches.

Thanks
-Martín
And happy new year!
Title: alGenSources fails after creating a bunch of sf::Sounds
Post by: Laurent on January 01, 2009, 12:06:10 pm
Anyway, you should never have to create 62 sounds at the same time, just re-use inactive sounds which are already allocated (I assume you don't play those 62 sounds at the same time).
Title: alGenSources fails after creating a bunch of sf::Sounds
Post by: nitram_cero on May 07, 2009, 07:51:51 pm
I don't think that's a good solution. 62 sounds is an awful low value for sound rich applications.

I don't use them but I could. Actually , those sounds where to be played when several different objects collided between themselves or the world. Boxes, tin cans, etc.

And I use one sf::Sound per Object.

Having to reimplement a queue to recycle sounds really beats the point of having a Sound object at all.

And also, 62 where my audio card max. But some cards only have up to 16 channels. An action game is most likely to have more than that number of consecutive sounds (Shots, enemy screams, hit sounds, explosions...).

You should point this out somewhere in the documentation, so library users send the SFML-SDK's OpenAL DLL with their software to aviod problems.

-Martín
Title: alGenSources fails after creating a bunch of sf::Sounds
Post by: K-Bal on May 08, 2009, 12:05:33 am
I would implement a SoundManager class that you can just use like this:

Code: [Select]


std::string filename = "somesound.wav";

SoundManager.playSound(filename);



If the file was already loaded, the manager just stops the current instance and plays it again from the beginning. This is how I use sounds in my projects and it works for my needs ;)
Title: alGenSources fails after creating a bunch of sf::Sounds
Post by: nitram_cero on May 08, 2009, 04:33:41 pm
Thanks, but that doesn't work for me.

Example: If you have two players charging the same type of weapon in different moments (shwoooooooooooooon TI TI TI) , then only one sound would be played. And the ready parte "TI TI TI" will only sound for the later charged.

With spatialization is even worst, as the sources come from different places.

I understand there is a limited amount of hardware accelerated channels, for that I use the software-OpenAL driver that downmixes everything by software to one channel (maximum compatibility).

Regards
-Martín
Title: alGenSources fails after creating a bunch of sf::Sounds
Post by: DustinBechler on October 04, 2010, 01:55:08 pm
Nitram is openal still worth using? I understand that it would speed things up a lot.
You could ever consider private salehoo review (http://salehooreview.org/) and / or maybe perfect uninstaller (http://perfectuninstaller.org/) to refurbish your laptop or computer and also for dinner you may health and well being gaze at truth about six pack abs (http://truthaboutsixpackabs.org/) and also for increased traffic look through a top seo tips (http://topseotips.org/) very quickly.
Title: alGenSources fails after creating a bunch of sf::Sounds
Post by: Spellbreaker on October 05, 2010, 11:15:09 am
PLease don't dig up 1 year old threads for such questions. Use PM or start a new thread.