0

I am writing my C code in Visual Studio and Im using the system() function in C to call wmplayer and play a sound:

system("C:\\Windows_Media_Player\\wmplayer C:\\Users\\lfanning\\Downloads\\sound .wma");

I call this in the middle of my main function however when I call it my program stops here and does not continue on with the next step.

How could I solve this?

Jean-Francois T.
  • 11,549
  • 7
  • 68
  • 107
leahf
  • 1

1 Answers1

0

Try writing it as follows

system("\"C:\Windows_Media_Player\wmplayer\" \"C:\Users\lfanning\Downloads\sound .wma\"");

Edit: Write it in a way that produces resulting string as "C:\Windows_Media_Player\wmplayer" "C:\Users\lfanning\Downloads\sound.wma" with quotes

Kamalesh Wankhede
  • 1,475
  • 16
  • 37
  • No that doesnt solve it, the system() part works as in it opens wmplayer and the song plays its just the next line of code its a printf statement and that never prints to the screen – leahf Apr 22 '16 at 13:05
  • try closing wmplayer after it is opened and see if execution continues. – Kamalesh Wankhede Apr 22 '16 at 13:08