What sound library do you all recommend for a C++ custom engine?

Started by
12 comments, last by RedBull4 3 years, 8 months ago

I recommend OpenAL Soft. It is small and portable to different operating systems.

The free software implementation can be found here: https://openal-soft.org/

It is LGPL licensed which means it is free to use forever and so long as you don't statically link against it (i.e using a .dll is fine) then you don't need to release your code under the GPL if you don't want to.

It is fairly easy to use for a positional audio library. There used to be a good tutorial on this site but I can't find it. I can point you towards one of my old projects with it in: https://github.com/osen/software-3d-renderer/blob/master/src/qplatform/Audio.cpp

Final thing I recommend is, rather than moving the “virtual ears” around, just pass object positions through the same view matrix you use to render them to the screen. I find this much cleaner and more flexible to get audio sources in the correct location. I am rambling, you will probably see what I mean when you get to it.

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.
Advertisement

[quote]I also use the native audio API for each platform, but instead of mmsystem I use WASAPI on Windows.[/quote]

Absolutely! mmsystem (wavOutOpen() and friends) was designed for 16-bit windows, where Sound Blaster DMA buffers were the other alternative. It's not a low-latency API, unfortunately. WASAPI can easily get to 30 ms end-to-end latency, though, which is usually enough for most games. If you need better than that, you really need bespoke APIs like ASIO, anyway, or a wrapper like PortAudio (which is still about low-level device access, not “play these sounds” high-level stuff.)

enum Bool { True, False, FileNotFound };

If you will not to make commercial projects you can use irrKlang. Tutorial: https://learnopengl.com/In-Practice/2D-Game/Audio

P.S. I prefer OpenAL-Soft for 3D sounds and SDL2 for 2D sounds.

SDL2 : D

None

This topic is closed to new replies.

Advertisement