First, you need prepare the wav voice file in the current folder, e.g., "door2.wav" here.
Then, just 1 line code needs:
#include <windows.h>
#include "tchar.h"
#pragma comment(lib, "winmm.lib")
int main()
{
PlaySound( _T("door2.wav"), NULL, SND_SYNC);
return 0;
}