2

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?

Community
  • 1
  • 1
Sossenbinder
  • 4,852
  • 5
  • 35
  • 78
  • can you try "play mp3" instead of "play mp3 wait" – Zohar81 Jan 10 '16 at 21:59
  • the call to `mciSendString("play mp3 wait", ...` does not return until playing has been finished. – wimh Jan 10 '16 at 22:00
  • @Zohar81 yes, that works, I'm already using it if I don't want continuos play, but I would have liked it to work that way as it would offer an easy continuos play implementation. It's possible otherwise as well but that would have been great if it would have worked out – Sossenbinder Jan 10 '16 at 22:05
  • @Sossenbinder, but play mp3 wait definition is to to play and wait until the *.mp3 has finished playing. you cannot change it in the middle afaik. – Zohar81 Jan 10 '16 at 22:09

1 Answers1

2

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);
Zohar81
  • 4,554
  • 5
  • 29
  • 82
  • Yeah, seems like I have to go that route and think of another way to implement a continous play with pause/stop functionality – Sossenbinder Jan 11 '16 at 09:59