I am getting a message from the palysound function it says File format not recognized i have linked the the compiler (i.e. dev c++) to the sound so if someone can help me i will be thank full
Code:
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <conio.h>
#include <windows.h>
using namespace std;
int main(int argc, char *argv[])
{
int m, s,h;
cout << " This is a COUNTDOWN TIMER " << endl;
cout << "Enter hours here" << endl;
cin >> h;
cout << "Enter minutes here " << endl;
cin >> m;
cout << "Enter seconds here" << endl;
cin >> s;
cout << "Press any key to start" << endl;
getch();
cout << " A COUNTDOWN TIMER" << endl;
cout << "time remaining" << endl;
cout << "H : " << h << "M : " << m << " S : " << s << endl;
for (int hour = h; hour >= 0; hour--)
{
for (int min = m; min >= 0 ; min--)
{
if ( min == 0 && h > 0)
m = 59;
for (int sec = s; sec >= 0; sec--)
{
if ( sec == 0 )
s = 59;
Sleep(750);
system("cls");
cout << hour << " :hours " << min << " :mins " << sec << " :secs" << endl;
}
} cout << "Timer done press. any key to exit" << endl;
PlaySound("C:\\Users\\PV\\Desktop\\shortcuts\alaram.wav", NULL, SND_ASYNC);
getch();
}
Sleep(1000);
return 0;
system("PAUSE");
}
Comment