Feb 26, 2007

C++ program to generate a beep sound from the PC speaker

C++ program to generate beep sound. Here for this purpose dos.h header file is used. In this program sound() function, delay() function and nosound() function are used.This program will generate beep sound from the PC speaker.
#include<iostream.h>
#include<conio.h>
#include<dos.h>
main()
{
clrscr();
sound(500); // 500 is frequency
delay(1000); // time delay in milliseconds
nosound(); // it will stop the sound
getch();
}

No comments:

Post a Comment

Infolinks In Text Ads

Total Pageviews

Powered by Blogger.

Dont Forget To Follow Us

Blog Archive