Make sound in C by R4R Team

For create any sound we require following three functions:
1. sound()
2. delay()
3. nosound()

1. Sound()
-It is use to create a sound.

Syntax-
sound(number)
-Here number can be any integer number like 0,1,2,......1000,...

2.Delay()
-Basically, this function is not the part of the sound programming but we use in this for our use.
-It hold the execution for given times or we can say that it delay the execution.

Syntax-
delay(time)

-Here time is in the mili second.

3. Nosound()
-It is used to close the runing sound.
-It just a opposite of sound() function.

syntax:
nosound()

-We do not require to pass any argument in this function.


program-

#include< stdio.h>
#include< conio.h>
#include< dos.h>
void main()
{
//Make a sound with 1000 value
sound(1000);
//Hold the sound for 1000 milisecond time
delay(1000);
//After 1 second, sound will be close by nosound();
nosound();
}

-In this program, when we execute then you may hear some sound.
-For making different time, change the value inside sound(number) function.




Leave a Comment: