A transparent "preemptive" priority sound manager
SFML-Audio is not an audio engine, the "word" manager is already out of its scope
There are better libraries if you want a more professional and complete engine (like FmodEx).
Plus, using a software implementation of OpenAL (like OpenAL-Soft which is more or less becoming the new standard -- and is what SFML uses on Windows), you can have any number of sources. The default is 256 but you can change it to whatever you want.
FmodEx has a commercial paid licence, ranging from u$s100 to u$s6000 per product.
That's the thingy. I don't have that kind of cash, not even the hundred bucks, to invest.
OpenAL-Soft, it may accept 256 sources but sometimes sounds don't start to even play (when my game is really filled with enemies).
I notice this because the shooting sound is fired 3 times per second, and it's really noticeable when it skips one.
I should look deeper into this, maybe making specific benchmarks.
Even thou, that wont address the "
sprite to graphics = sound to audio" point.
For an entity I can have as many sprites as I want (eg. cannons, ship, rockets, cockpit, etc.), but not multiple sounds.
If I have 100 entities that own 5 sf::Sounds, (charge shoot, shoot, move, collide, destroyed). It will fail.
(As a comparison, in space invaders there are 55 invaders per screen... 100 isn't really a big number)
That makes the Sound class not really useful.Perhaps not a manager, but a
simple Source pool.
That makes SFML "own and handle" OpenAL's sorces, and those could be acquired or releseased by sf::Sound depending on the sound's state: playing or paused/stopped, respectively.
It's not trivial to implement if you want Sounds to be able to play more that once at the same time.
Regards
-MartÃn