#include <Windows.h>
int main()
{
PlaySound(TEXT("D:\\Waste\\ncnu.wav"), NULL, SND_FILENAME);
return 0;
}
#define _CRT_SECURE_NO_WARNINGS
#include <iostream> // You need this for swprintf()
#include <Windows.h>
int main()
{
char phoneNumber[] = "0492910960";
char fn[80];
for (size_t i=0; i<strlen(phoneNumber); i++)
{
sprintf(fn, "D:\\Waste\\DTMF%c.wav", phoneNumber[i]);
PlaySound(fn, NULL, SND_FILENAME);
}
return 0;
}
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using std::cout;
using std::endl;
int main(int argc, char* argv[])
{
char fn[20] = "a.out";
if (argc == 2)
strcpy(fn, argv[1]);
FILE *fp = fopen(fn, "rb");
fseek(fp, 0L, SEEK_END);
int length = ftell(fp);
cout << length << endl;
fclose(fp);
return 0;
}
000000 47 6f 6f 64 20 6d 6f 72 6e 69 6e 67 2e 20 20 49 Good morning. I
000010 20 77 61 6e 74 20 74 6f 20 72 75 6e 20 61 20 74 want to run a t
000020 65 73 74 2e 0a 49 20 62 6f 75 67 68 74 20 61 20 est..I bought a
000030 63 61 72 20 69 6e 20 32 30 30 38 2c 0a car in 2008,.
char* buffer = new char[length];
fread(buffer, 1, length, fp);
to load
the file into the memory buffer.
PlaySound(buffer, NULL,
SND_MEMORY);
to play it.