Thread: Pc-speaker

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    100

    Cool Pc-speaker

    How can I make PC-speaker to produced different sounds (beeping).
    Sauron a few seconds before his defeat:
    "What? A 'division by 0' error?!?"

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    247
    Hi,
    You could use " \a" which is the bell.
    Example
    Code:
        printf("\n \a ERROR Invalid Input");
        /*to prompt user input is invalid*/
    hoping to be certified (programming in c)
    here's the news - I'm officially certified.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    100
    Well... I knew that one already,

    but thanx anyway.

    P.S.
    Does anyone know how to change the tone of the beeping?
    Sauron a few seconds before his defeat:
    "What? A 'division by 0' error?!?"

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    1

    Thumbs up

    U can use sound function with different frequencies to achive
    what u want

  5. #5
    Ethereal Raccoon Procyon's Avatar
    Join Date
    Aug 2001
    Posts
    189
    Yet another compiler-dependent thing... which one are you using?

    In Borland C, use the sound(int freq) function in dos.h to play a sound out through the PC speaker.

    I don't think you can change the alarm tone in most compilers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Outputting many beeps through the pc speaker
    By rllovera in forum C Programming
    Replies: 18
    Last Post: 11-21-2006, 12:24 AM
  2. Replies: 1
    Last Post: 10-27-2006, 01:21 PM
  3. Using PC Speaker and NOT the sound card in a console...
    By Trauts in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 04-09-2003, 08:52 PM
  4. !how do i use the PC speaker
    By unknownUser in forum C++ Programming
    Replies: 5
    Last Post: 05-23-2002, 10:38 AM
  5. PC Speaker...
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 04-03-2002, 08:19 AM