0

I want to play a mp3/wav music file using cpp language. My cpp file and the music file (say abc.mp3) are in the same folder. I have given my code below. Where my music file plays by my PC's default music player. I want to play the music file like the cout << "\a"; plays a sound while running the code.

int main()
{
cout << "Playing your music file" << endl;

//Code to play my music
system("music1.mp3");

cout << "\a";
cout << "Music played successfully" << endl;



return 0;
}

It will be great for me if anyone provides me a sample code while running the code will play music without using any external player.

0 Answers0