Simple Sound Program In C Language



In this post, You can create simple sound programm in C language.

Here, i am using only three function of "dos.h" header.

  • sound() function
  • delay() function
  • nosound() function
1. sound() function
  • sound() function turns the computer speaker on at the specified frequency.
2. delay() function
  • delay() function spends the execution for interval (miliseconds).
 3. nonsound() function 
  • nonsound function turns the computer.

Let's see the simple program of sound() function, delay() function, nosound() function.

#include<dos.h>

void main()
{
        int i;
        while(i==2000)
        {
               sound(i);
               delay(1000);
               i+100;
        }
      nosound();
}

No comments: