Showing posts with label Programming Code for Sound System. Show all posts
Showing posts with label Programming Code for Sound System. Show all posts

How to make a sound program with C language

Problem:  How to make a sound program with C language.

Solution

Sound is necessary for any programming language. When you make a game with C language , you need sound to make it attractive. To make a sound you can use a build- in function named sound().sound() function takes a parameter which indicates frequency level of sound. You can get any frequency level of sound using this function. A programming code is given bellow.

Example: Programming Code for Sound System

 #include<stdio.h.>
#include<conio.h>

void main()
{
     int i;
    clrscr();
    printf(“Making sound………………”);
    for(i=0;i<100;i++)
      {
          sound(250*i);
          delay(250);
          nosound();
      }
getch();
}

Output
Making sound ………………..