Thursday, July 30, 2009

Any C- Language Programmer please help me...............?

HELP ME.....Following is one short program I tried








#include%26lt;dos.h%26gt;





int main(void)


{


sound(60);


delay(30000);


nosound();


return 0;


}











In this program I tried to add sound to my c program


but its not working...





I mean its compiling as well as running but I can't hear any sound.......





Why is that ??????





my speakers are ok and working and are not mute either.........

Any C- Language Programmer please help me...............?
Hi,


if I remember well the sound command of the dos.h "library" accept as argument the frequency of sound to emit.


Probably 60Hz is a frequency to low for your ear.


Remember that the low-limit of the human ear is 20Hz, so is very closely to this limit.


Try with a frequency of 440Hz (the H note ;)





If you can't hear this frequency too, the problem should be that you are not using a DOS system, but instead a MS Windows one... in this case should be that windows does not permit the DOS function call works correctly.





cheers.
Reply:This type of sound wouldn't come through your speakers but through your motherboard. Back in the day your Motherboard had a small speaker more as a way to sound a beep. I think most still have it. Thats the where the sound would come from. But I think now days we either turn this speaker off (in the BIOS) or it doesn't work the same way.


Sorry i'm not more of a help.


(I just know I have tried to get a "beep" to work in other programs and never could hear it)


No comments:

Post a Comment