How to send the cpu sound to my speakers in a c program?

Hi I am using sound function to generate sounds of certain frequencies.
The sounds generated re coming out from the cpu.
i want them to come out from speakers.
Please suggest me how to do the same.

Here is the code:

#include<iostream.h>
#include
#include<conio.h>
void main()
{
sound(240);
getch();
nosound();
sound(270);
getch();
nosound();sound(300);
getch();
nosound();sound(320);
getch();
nosound();sound(360);
getch();
nosound();sound(400);
getch();
nosound();sound(450);
getch();
nosound();
sound(480);
getch();
nosound();

return;
}
1 answer Last reply
More about send sound speakers program
  1. By from the CPU I'm guessing you mean it's coming from the motherboard speaker. You're trying to get sound to be emitted by your onboard sound device or via your soundcard.

    I don't know the C in question but you probably need to get a handle on the sound device and call the appropriate function by their API.
Ask a new question

Read More

Programming Speakers CPUs Apps