Answer the question
In order to leave comments, you need to log in
How to display sound effects in games?
Hello.
I am writing my simple toy, I use OpenAL to work with sound. Playing background music was easy, but what's the right way to play sounds? How are they mixed? On the Internet I found only examples for outputting music. Can someone share a piece of code?
Answer the question
In order to leave comments, you need to log in
In my opinion, there is nothing special to do for mixing. You just create a new source using alGenSources(1, &source), and then everything is the same as for music - create buffers, fill them with data, clear the played buffers.
I think that it will be easiest to look in the code of some game engine. There are a lot of nuances and non-obvious things in OpenAL.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question