cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Music
Music
Sep 6, 2017 at 6:53am UTC
Raul4pk
(31)
How can I have a song play in the background of my program ?
Sep 6, 2017 at 12:52pm UTC
Ganado
(6812)
C++ by itself does not assume you have a monitor, or fancy graphics. You need a third-party library that can work with your OS to do this.
If you know C++, SFML is a nice simple, multi-platform library that can play audio.
https://www.sfml-dev.org/tutorials/2.4/audio-sounds.php
SDL is another alternative (written in C, compatible with C++), but I have not used it.
You can try that out, or if you just want it on a console on Windows, check this out
http://www.cplusplus.com/forum/beginner/3589/
https://stackoverflow.com/questions/9961949/playsound-in-c-console-application
Topic archived. No new replies allowed.