0

Originally my code is like below:

mciSendString("play bgm.wav", NULL, 0, NULL);

However, I find that when the music is finished, it can not repeat. I try the

mciSendString("play bgm.wav repeat", NULL, 0, NULL);

as well, and it does not work. Can someone help me?

Alex K.
  • 171,639
  • 30
  • 264
  • 288
Pai
  • 327
  • 1
  • 3
  • 10
  • Check the device have which command line argument for repeat functionality. – Sumeet May 06 '16 at 12:48
  • Could you give me an example? I don't know what's your mean for checking the device...Sorry, I am new to c++. – Pai May 06 '16 at 12:49
  • bgm == background music? Perhaps simpler to call [`PlaySound()`](https://msdn.microsoft.com/en-us/library/windows/desktop/dd743680(v=vs.85).aspx) w/ SND_LOOP | SND_ASYNC – Alex K. May 06 '16 at 12:59
  • https://support.microsoft.com/en-us/kb/124185 – Sumeet May 06 '16 at 12:59
  • http://stackoverflow.com/questions/15490552/mp3-playing-using-mci-send-string-c – Sumeet May 06 '16 at 13:00
  • @Sumeet, what does I try the mciSendString("play bgm.wav notify repeat", NULL, 0, hand); however, identifier hWnd is not defined....What does hWnd means? Someone told me that I need to include however, it still does not work. – Pai May 06 '16 at 13:08
  • hand is the HANDLE of CreateWindow. In your case I guess you have not created the window. – Sumeet May 06 '16 at 13:16

1 Answers1

0

Try this:

mciSendString("play mp3 wait repeat", NULL, 0, NULL);