Programmer often notify user using messagebox in Windows and with colored strings in console in DOS. Additionally programmer can make sounds in PC Speakers. This is useful when very critical events happened and user has to be informed as soon as possible.

Windows subsystem has one API called Beep() to make a noice of a perticuler frequency for some duration.

BOOL WINAPI Beep(
  _In_  DWORD dwFreq,
  _In_  DWORD dwDuration
);

C runtime under DOS has sound() and nosound() library call avaible for this. sound() takes input frequency and turns on the speaker and nosuond() stops the speaker. Thus some delay has to be there between sound() and nosound() to make it audible.

  sound (frequency);
  delay (duration);
  nosound ();

About our authors: Team EQA

You have viewed 1 page out of 252. Your C learning is 0.00% complete. Login to check your learning progress.

#