hi guys, i wanted to know whether it is possible to access the hardware unit (say, speaker) using a c program. And if so, how?
I google'd, but did not get an apt answer. Help me pls..
hi guys, i wanted to know whether it is possible to access the hardware unit (say, speaker) using a c program. And if so, how?
I google'd, but did not get an apt answer. Help me pls..
It depends on your OS and compiler, and possibly how much you feel like playing with assembly (or some library that is already written for you). If YOU want to access it directly, without libraries someone else has written, then it's going to be entirely OS, compiler, and likely, assembly (ASM) specific work.
Quzah.
Hope is the first step on the road to disappointment.
Most operating systems do not allow direct hardware access.
You either go through the drivers or not at all...
And yes, this makes perfect sense when you consider what could be done if someone had direct access to, say, your hard disk...
If you want to make noises out of your speaker...
If you're looking to play wave sounds... Look at the PlaySound() API call.Code:#include <windows.h> int main (void) { Beep(500,300); Sleep(200); Beep(1000,300); Sleep(200); Beep(400,300); return 0;}
If your looking to play MP3s or such ... Look at MCI and Direct Sound APIs.