Search code examples
c++mcisendstring

Is there a way to pause/stop a mp3 file playing with mcisendstring with the "wait" option?


I am currently trying to create an mp3 player with the commands offered in this answer.

Actually it's working pretty great, but right now I am trying to implement a continuos play with

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

This command is supposed to play an mp3 file from start to finish and wait until it has actually finished playing.

This is working correctly, however, I was convinced before trying it out, that pause or stop commands which work with usual play would work here as well:

mciSendString("pause mp3", NULL, 0, NULL);

mciSendString("stop mp3", NULL, 0, NULL);

However, every command seems to be unresponsive towards the running mp3.

There are no error messages or anything, it just doesn't work the way I have it right now.

Is there any way to accomplish this? Any additional parameters I would have to send with my pause/stop commands?


Solution

  • You can use the wait/stop commands if the play command will be modified to avoid waiting until the *.mp3 has finished playing.

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