1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

The bell won't toll

Discussion in 'Software Development' started by Riverglen, Sep 16, 2018.

Thread Status:
Not open for further replies.
Advertisement
  1. Riverglen

    Riverglen Thread Starter

    Joined:
    Aug 28, 2006
    Messages:
    478
    First Name:
    Larry
    I have a very old program that I wrote in C years ago. When a certain alert condition is met, the program is supposed to ring an audible alert. I did this by simply sending the ASCII bell character to the console device. This has always worked just fine running in several successive old machines under Windows 98. The machine it had been running on finally bit the dust and I replaced it with another antique, still running Win-98. But now, I don't get any bell sound when an alert occurs.

    The machine produces all of the Windows sounds as you would expect, but nothing when I send the bell character. I have already checked the sound settings from the Control Panel sound applet, and have confirmed that the Windows default sound is enabled. The sound volume is turned up to an adequate setting, mute isn't enabled. The "ding" sound that results from adjusting the volume setting is heard just fine.

    So..... What am I missing?
     
  2. SpywareDr

    SpywareDr

    Joined:
    Mar 30, 2014
    Messages:
    2,595
    Years ago, systems had a small internal "PC speaker" connected to the motherboard for "system sounds". Nowadays, they don't. Some do still have the pins to connect one to though.
     
  3. Riverglen

    Riverglen Thread Starter

    Joined:
    Aug 28, 2006
    Messages:
    478
    First Name:
    Larry
    Well, when I wrote the initial version of the program, it was with the expectation that I would be running it on an "IBM PC compatable" machine under MSDOS. I expected it to cause a chirp from the motherboard speaker. By the time I got it running, I was running Windows 98 and was more than a little amazed that the program would run at all under that operating system. (In fact, but for the evolution of video standards, I'm pretty sure it would run in any Windows system, up through Win-7.)

    But in any event, on all but machine it is currently running on, sending a bell character to the console results in the Windows default sound, a melodious "ding". I have no theory for why the current machine doesn't do the same thing. I wrote a little one line program to see what I'd get on other machines. On my Win-7 desktop, the result is a very un-windows like beep, but it comes from the system (not the non-existant motherboard) speaker.
     
  4. managed

    managed Trusted Advisor Spam Fighter

    Joined:
    May 24, 2003
    Messages:
    10,684
    First Name:
    Allan
    Windows 98 was still using MS-DOS as a base but starting with XP the cmd prompt uses an emulation of MS-DOS, which could explain some of the behaviour you're getting.

    If you look here :- https://stackoverflow.com/questions/49466834/echo-a-bell-character-cmd
    it shows a way to send the bell character from a .cmd file and that works on my Windows 7 however it makes a beep that is not the same as any built-in windows sound.

    If you run the command BEEP in a windows 7 cmd window it isn't recognised but it works in MS-DOS.

    Can you post the code you use so we can try it ?
     
  5. SpywareDr

    SpywareDr

    Joined:
    Mar 30, 2014
    Messages:
    2,595
    FWIW - Alternative to a plug-in PC Speaker, like this one:

    [​IMG]

    an onboard|built-in motherboard speaker, like so:

    [​IMG]

    is a very basic speaker responsible for start-up and error beeping noises, as well as other very basic mono tones. Unlike a the above PC Speaker it is usually not capable of playing complex sounds such as music etc.
     
  6. Riverglen

    Riverglen Thread Starter

    Joined:
    Aug 28, 2006
    Messages:
    478
    First Name:
    Larry
    The following little test program uses the same technique to send a bell character as I use in the actual application, and produces the same result.

    Code:
    /* Quick test of the console beep function */
    
    #include <conio.h>
    
    void main(void)
    {
        putch(0x7);
        return;
    }
    When run on my Win-7 machine, I get the same non-windows like beep that I assume is the same as what Allan described above. The sound is NOT coming from any sort of motherboard speaker, but is definitely coming from the normal speakers attached to the Windows sound output. When run on the problem machine, no sound results.

    In any other machine I've run the actual application on, this technique has produced what I believe is the Windows default "ding" sound, and it comes through the windows sound system. If you go to the sound applet from the Control Panel, the sound I expect to hear is the Windows Default Beep.

    I've already confirmed that the Windows Default Beep is enabled on the problem machine, and in fact have heard it on that machine as a result of adjusting the volume using the volume control applet in the system tray. When you reset the volume from that control, you get the "ding".

    Remember that I've had no such problem on several other machines that ran this program under Windows 98. Whatever is going on seems to be specific to this particular machine.
     
  7. managed

    managed Trusted Advisor Spam Fighter

    Joined:
    May 24, 2003
    Messages:
    10,684
    First Name:
    Allan
    Using your test program gives me the same beep I get with the method at my link in post #4, both give a beep sound from the speakers on my laptop that is not the same as any built-in windows sound.
     
  8. Riverglen

    Riverglen Thread Starter

    Joined:
    Aug 28, 2006
    Messages:
    478
    First Name:
    Larry
    So, you're getting the same result I do when I run the test in a Win-7 machine. Just for the heck of it, I tried the test in a Win-98 VM that I keep around to play with. And in that environment, I get the default windows chime "ding" rather than the raw beep that is heard in Win-7. The difference is consistent with your conjecture that things have evolved from the days of Win-98 to Win-7. But in either case, at least you hear SOMETHING.

    But still unexplained is why the target machine won't chime. I compared the control panel sound settings for the VM and the target machine to confirm that they are set up the same.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1216614

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice