R
R
Robotex2013-08-02 18:36:49
Audio
Robotex, 2013-08-02 18:36:49

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

1 answer(s)
B
Biga, 2013-08-02
@Robotex

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 question

Ask a Question

731 491 924 answers to any question