How to make Motherboard Beep through C++ Code? [closed]

大城市里の小女人 提交于 2021-01-27 16:10:45

问题


How can I make the motherboard internal speaker produce sounds, for example using the Beep command but directed towards the motherboards speakers.

OS = Windows 7 x64

I currently know how to provide beeps to the default sound device, including tone and millisecond's but this does not answer my question since I cant force any of these sounds towards the motherboard internal speakers.

Beep(523, 500);

My question is mainly based around an alternative to Beep which would play through the motherboards speakers rather than the computer audio card. Or a way to direct the Beep command or incoming audio frequencies towards the motherboards speakers.


回答1:


The question was later specified to refer to Win32 programming environment, this question describes a Linux solution.

You can use the KIOCSOUND ioctl to generate a tone, as such

ioctl(fd,KIOCSOUND,(int) tone)

The Linux Programming Interface is a fabulous book that describes using IOCTLs in detail, but there are public resources that describe the IOCTL such as the perennially classic TLDP.




回答2:


In Windows 7, Beep was rewritten to pass the beep to the default sound device for the session. This is normally the sound card, except when run under Terminal Services, in which case the beep is rendered on the client. source

There is apparently one possible modification of system descibed here.



来源:https://stackoverflow.com/questions/38883092/how-to-make-motherboard-beep-through-c-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!