Sound in c++

Hello everyone, how can i play sound in c++ and can you give me a library ? Thanks you
OpenAL, SDL, SFML, DirectSound. All these are capable of outputting audio generated on-the-fly.
If you're on visual C++, go project properties -> Linker -> Input -> Additional Dependencies. There, add in the following library (copy and paste): winmm.lib;

This will enable the PlaySound function, go here to learn how to use it effectively https://msdn.microsoft.com/en-us/library/windows/desktop/dd743680(v=vs.85).aspx.

Note that this library is OS-dependent and it won't compile on non-windows operating systems. So if you're aiming to make your code portable, don't use this. Use a cross-platform library instead. But if you're just writing for windows, then you should be fine with just the winmm library. You also don't have to include any header files to use the function. Just make sure to link the library to your project.
I recommend FMOD API for developer , fairly simple
Topic archived. No new replies allowed.