2

i am trying to play a sound file with spaces in its name

example: "my File.wav"

So sending files like this:

mciSendString("play C:\\myFile.wav",0,0,0);

will work just fine. but:

mciSendString("play C:\\my File.wav",0,0,0);

will fail.

is there any solution to this problem?

Eran
  • 81
  • 1
  • 6

1 Answers1

1

On Windows, paths containing white characters must be wrapped with quotation marks. So instead of:

mciSendString("play C:\\my File.wav", 0, 0, 0);

write this:

mciSendString("play \"C:\\my File.wav\"", 0, 0, 0);

That should work.

Mateusz Grzejek
  • 11,698
  • 3
  • 32
  • 49