Windows - Can console output inadvertently cause a system beep?

I have a console application in C # that writes a lot to the console (using Trace ). Some of the files that it registers are a compressed representation of a network message (therefore, many of them are displayed as fake non-alphabetic characters).

I get system sounds every time the application is running. Is it possible that some kind of "text" that I write to the console causes them?

(By system sound, I mean the woofer inside the PC case, and not any WAV sound scheme)


If so, is there a way to disable it for my application? I want to be able to output any possible text without being interpreted as a sound request.

+4
source share
6 answers

If you do not want to beep, you will either have to replace the 0x7 character before outputting it, or disable the Beep device driver, which you will find in the section “Drivers without Plug and Play”, visible if you enable the “Show hidden” option devices. " Or take out the speaker.

+3
source

This is usually caused by issuing character code 7, CTRL-G, which is a BEL (ringing) character.

The first thing I usually do when I buy a new computer or motherboard is that the wire from the motherboard to the speaker is not connected. I have not used the speaker since Commander Keene (and removing this wire is the best OS-agnostic way to stop the sound :-).

+19
source
 HKEY_CURRENT_USER\Control Panel\Sound 

set the Beep parameter to no.

+5
source

absolutely, if you output the ASCII "Bell" control code (0x7) to the console, it beeps.

+4
source

Even if you check the entry of the BELL characters, it may still beep. This is due to font settings and Unicode conversion. The symbol in question is U + 2022 , Bullet.

Raymond Chen explains :

On the OEM code page, the bullet symbol is converted to a beep. But why is that?

What you see is MB_USEGLYPHCHARS in reverse order. Michael Kaplan previously discussed MB_USEGLYPHCHARS. It defines whether characters should be treated as control characters or as printed characters when converting to Unicode. For example, it controls whether to convert the ASCII bell character 0x07 to Unicode character bell U + 0007 or Unicode bullet U + 2022. You need the MB_USEGLYPHCHARS flag to decide where to go when converting to Unicode, but there is no corresponding ambiguity when converting from Unicode When converting from Unicode, both U + 0007 and U + 2022 display the ASCII bell character.

+3
source

\ b in the output line will cause a sound signal if it is not disabled at the OS level.

+1
source

Source: https://habr.com/ru/post/1285667/


All Articles