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 ();

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

 Vote 0

Similar topics related to this section

printf, scanf, ioctl, mmap, DOS low level IO access, DOS BIOS int86, sleep/delay, sound, nosound, DOS graphics, Turbo C graphics,

# C Programming Language (Prentice Hall Software)
# Let Us C Paperback - 2006 by Yashavant Kanetkar
# Understanding and Using C Pointers Core techniques for memory management
# Data Structures Using C and C++ Paperback - 1998
# Data Structures In C Paperback - August 11, 2008 by Noel Kalicharan