PC speaker beep is no longer (natively) supported by 64-bit Windows starting
from Windows 7. 32-bit versions still support PC speaker beep.
The reason why the PC speaker won't beep is because of Microsoft want
Windows to support some server class computers which don't have a
Programmable Interrupt Controller (PIC) chip which is normally used to drive
the PC speaker on and off along with a Programmable Interval Timer (PIT)
chip.
(long URL warning)
https://docs.microsoft.com/en-us/archive/blogs/larryosterman/whats-up-with-the-beep-driver-in-windows-7
But Microsoft's solution is lazy one: by using sound card to make the beeps.
FYI, making PC speaker beeps DOES NOT actually require a PIC chip. The use
of PIC in this case is to provide a notification when a timer has been
triggered, so that the program doesn't have to repeatedly ask "is it time
yet?" - which will consume CPU computing time. IOTW, PIC help offload the
waiting time from the CPU to the PIC chip. i.e. PIT signals the PIC, which
in turns, signals the CPU to execute some code. And for timing accuracy's
sake, that repeated time check must not be interrupted for e.g. executing
other thread. So for timing accuracy's sake, it will require one CPU core
dedicated just for repeatedly checking whether the time is up or not. While
this is not multitasking friendly, it IS possible to use beep without a PIC.
64-bit solution is not impossible, but it's problematic. By using 64-bit
Windows XP's Beep driver (BEEP.SYS) to replace the one in Windows 7 or
newer. It's problematic due to Microsoft's monopolizing driver signature
enforcement policy, since the XP driver has no digital signature. The driver
signature check can be disabled, but it has to be done manually during the
OS boot, and the process has been made less convenient since Windows 8
(users have to reboot TWICE just to access to the OS boot menu). 64-bit
Vista embed the beep driver in one of its kernel files, so it's impossible
to retrieve its beep driver.
Third party solution is possible using either a generic hardware I/O driver,
or 64-bit XP driver which is digitally signed. So far, I only found one. I
haven't actually checked it yet (i.e. whether the digitally signed driver is
actually accepted by Windows), but it seems to have all of the needed
components.
https://github.com/cocafe/pc-beeper
Download from the "Releases" sidebar section.
There's also RecallXpBeepStyle project, but its application is a GUI based
one, so it's not usable from command line. The interresting thing is that,
it uses an XP driver, so it can be used to replace the one in Windows 7 or
never. The driver file is in: EventExample/bin/Debug. Or just download the
whole package from the "Code" button then "Download ZIP" link.
https://github.com/LinZong/RecallXpBeepStyle