#include <windows.h>
#include <mmsystem.h>
#include <iostream>
void main()
{
PlaySound(TEXT("flip.wav"), NULL, SND_ASYNC);
system("pause");
}
This code works perfectly. Self explanatory as to what it does. When I debug in VS2012 Express IDE, everything compiles and the audio plays. Save, close, go to debug file, press .exe, the cmd pops up but the audio doesn't play. Open the IDE again and debug, and works fine. Save, close, press .exe again and still nothing. What factor am I missing?
Aucun commentaire:
Enregistrer un commentaire