The bell won't toll

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Riverglen

Thread Starter
Joined
Aug 28, 2006
Messages
519
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?
 
Joined
Mar 30, 2014
Messages
3,901
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.
 

Riverglen

Thread Starter
Joined
Aug 28, 2006
Messages
519
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.
 

managed

Trusted Advisor
Spam Fighter
Joined
May 24, 2003
Messages
13,662
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 ?
 
Joined
Mar 30, 2014
Messages
3,901
FWIW - Alternative to a plug-in PC Speaker, like this one:



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



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.
 

Riverglen

Thread Starter
Joined
Aug 28, 2006
Messages
519
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.
 

managed

Trusted Advisor
Spam Fighter
Joined
May 24, 2003
Messages
13,662
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.
 

Riverglen

Thread Starter
Joined
Aug 28, 2006
Messages
519
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.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Members online

Top