ANGER | The sound thing
Posted by core in ANGER, muddle-code, projects, tags: ANGER, development, linux, soundMost of the time I develop in the Mac OS X environment while fidel is testing under linux. The game provides some sound effects which worked only on the mac. We first thought about having a problem with the general problem with the soundengine on linux. Playing around with Open-AL, ALSA and different sound configurations ended up all in deep silence.
I was close before giving up. Time goes by and I restart investigating the problem. I first checked the sound sample of SFML library which worked !
But why ? I compared the sources and then I catched the problem. To play sound the system uses two objects: sound and soundbuffer. I was using the objects but it did not work. What was wrong ? The solution is quite simple. The game uses multiple sounds and so I handled all sounds in a manager object. But the sound manager had one big logical mistake. Each time I accessed the manager to start playing a sound, the manager made a copy of the objects and started playing. The copy was the problem because after start, the object was destroyed (local scope). The destroy stops playing which results in silence :-)
Rewriting the storage of the sound objects the sound works now. Yeah!
Support muddle-code




Entries (RSS)