How to add music to a C++ Repl?
Asking for a text-based-game project i've been working on for school, and i've already read https://docs.replit.com/repls/audio , I just don't understand how it is that I could apply that to C++ (if that's even possible to begin with).
Thanks in advance.
EDIT: What i've gathered is that in order to have audio work in C++, you'd have to call a code from python that would run the audio. My problem is that i've only got a fundamental understanding of C++ and absolutely zero knowledge on python. So, how would you call a python file from C++? I tried the system("") method suggested by 19ecal to no avail and I couldn't make sense of the ostream method. Could you dumb your answers down to my level, or maybe present another, even simpler method?
Again, thanks in advance.
Well, you could make a .py file like this
import sys from replit import audio source=audio.play_file(sys.argv)
Then you can call it from C++
system("python sound.py file.mp3")
All of this is untested
You might want to make a function to play a sound file you pass it in c++ though
And you might have to
#include <cstdlib> as well