How to make a simple music program? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to make a simple music program?

please help us

27th Sep 2018, 4:58 AM
Prince Mujeeb
Prince Mujeeb - avatar
2 Answers
+ 2
that's is not working program
3rd Oct 2018, 11:44 AM
Prince Mujeeb
Prince Mujeeb - avatar
+ 1
if you use code blocks goto setting -> compiler -> linker setting -- then on the right box write -lwinmm in your cpp program #include <Mmsystem.h> #include <mciapi.h> //these two headers are already included in the <Windows.h> header To open *.mp3: mciSendString("open \"*.mp3\" type mpegvideo alias mp3", NULL, 0, NULL); To play *.mp3: mciSendString("play mp3", NULL, 0, NULL); To play and wait until the *.mp3 has finished playing: mciSendString("play mp3 wait", NULL, 0, NULL); To replay (play again from start) the *.mp3: mciSendString("play mp3 from 0", NULL, 0, NULL); To replay and wait until the *.mp3 has finished playing: mciSendString("play mp3 from 0 wait", NULL, 0, NULL); To play the *.mp3 and replay it every time it ends like a loop: mciSendString("play mp3 repeat", NULL, 0, NULL);
27th Sep 2018, 6:46 AM
estifanos
estifanos - avatar