Playing User Audio

For the game I am am making I need a script that plays a random sound, these would involve sounds in the project as well as audio files on the user’s desktop or in their music folder, does anyone have any idea on how to do this, or where to start?

If you could explain all the code does that would be great as I am new to C++ and want to learn!