Play music

How to play music

I want to play music using command like this.

system("start 1.GanbalanceDeDance.mp3");

but the program opens without playing song, do we need to #include anything or specify a path of song.
Well I don't know what it is in Windows, but in linux it would be something like this:

 
system("vlc Break.mp3");


That is actually the wrong command for opening a file I think, but what I'm getting at is you may have to tell the program that you play music in to open it with the system call.

[EDIT] Turns out I didn't need --open as that was for streaming. You may have to google or just experiment with things like the above. Or maybe someone will know how to do it in Command prompt.
Last edited on by closed account z6A9GNh0
In windows we have ShellExecute for things like that, passing file name as command line argument (this is what explorer does when double-click an mp3 file.)
there is also a Play() function in windows API afaik.
I know what Windows has, I just meant I didn't know the command to use. I've not touched a Windows OS since using Vista for gaming in 2011. I live solely under my Linux OS and just pull from memory when I can for Windows related topics.
Umm, can tell me, how to link the program to open other songs in computer?
Topic archived. No new replies allowed.