View Single Post
Old 01-11-2009   #1
Google

 
Google's Avatar
 
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
Default Free Patriotic Movement Tone In C++

In my free time, I coded this small program that generates the FPM tone using the beep() function. This is the code:

Code:
//Free Patriotic Movement Tone By Edgard Chammas
#include <windows.h>
#include <time.h>

void sleep(unsigned int mseconds);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)

{
        Beep( 750, 200);
        Beep( 750, 200);
        Beep( 750, 200);
        sleep(100);
        Beep( 750, 400);
        sleep(50);
        Beep( 750, 500);
        sleep(200);
        Beep( 750, 300);
        Beep( 750, 300);
        Beep( 750, 300);

     return 0;
}

void sleep(unsigned int mseconds)                                
{
    clock_t goal = mseconds + clock();
    while (goal > clock());
}
Now your PC can be upgraded to support GMA!

Note: The compiled executable file is here <> in case you don't have a compiler...

Google is offline   Reply With Quote
The Following User Says Thank You to Google For This Useful Post:
Kingroudy (01-11-2009)