我为什么不调用Windows 7中的蜂鸣功能后听到任何声音? [英] Why don't I hear any sound after calling the Beep function in Windows 7?

查看:246
本文介绍了我为什么不调用Windows 7中的蜂鸣功能后听到任何声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的code:

#include <windows.h>
#include <stdio.h>

int main(void)
{
        Beep(523, 500);
        Sleep(1000);
        return 0;
}

我使用的MinGW与开发 - C ++编译它。我的问题是,我什么都听不到,虽然我没有得到一个错误。我有Windows 7的任何想法?

I am compiling it using MinGW with Dev-C++. My problem is that I can't hear anything, although I don't get an error. I have Windows 7. Any ideas?

推荐答案

打开扬声器。如果他们已经打开,调高音量。如果您没有扬声器和计算机上安装声卡,然后得到一些并安装它们,然后尝试再次运行程序。

Turn your speakers on. If they're already on, turn up the volume. If you don't have speakers and a sound card installed on your computer, then get some and install them, then try running the program again.

所有这些事情都听到来自 提示音在Windows 7上的功能 href=\"http://blogs.msdn.com/b/larryosterman/archive/2010/01/04/what-s-up-with-the-beep-driver-in-windows-7.aspx\">It不再扮演从内置的硬件系统,扬声器的声音。的相反,声音传递到默认的声音设备为您的用户会话。在一个标准的本地用户会话,这将是你的声卡。文档中的备注一节中解释了这一重要细节:

All of these things are required to hear anything from the Beep function on Windows 7. It no longer plays sound from the built-in hardware system speaker. Instead, the sound is passed to the default sound device for your user session. In a standard local user session, that would be your sound card. The documentation explains this important detail in the "Remarks" section:

很久以前,所有的PC计算机共享一个通用可编程8254间隔定时器的原始声音的代芯片。在蜂鸣函数专门写发出那块硬件的蜂鸣声。

A long time ago, all PC computers shared a common 8254 programable interval timer chip for the generation of primitive sounds. The Beep function was written specifically to emit a beep on that piece of hardware.

在这些老的系统,静音和音量控制对蜂鸣没有影响;你仍然会听到提示音。沉默铃声,您使用以下命令:

On these older systems, muting and volume controls have no effect on Beep; you would still hear the tone. To silence the tone, you used the following commands:

net stop beep  
sc config beep start= disabled


  
  

自此以后,声卡已经成为标准装备的几乎所有PC电脑。由于声卡逐渐普及,厂商开始删除计算机上的旧定时器芯片。该芯片也被排除在服务器计算机的设计。其结果是,蜂鸣并没有在芯片上的所有计算机上运行。这没关系,因为大多数开发人员都转移到调用<一个href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/ms680356.aspx\"><$c$c>MessageBeep使用无论是默认的声音设备,而不是8254芯片功能

Since then, sound cards have become standard equipment on almost all PC computers. As sound cards became more common, manufacturers began to remove the old timer chip from computers. The chips were also excluded from the design of server computers. The result is that Beep did not work on all computers without the chip. This was okay because most developers had moved on to calling the MessageBeep function that uses whatever is the default sound device instead of the 8254 chip.

终因缺乏硬件与沟通,为蜂鸣支持Windows Vista和Windows XP 64位版本。被丢弃

Eventually because of the lack of hardware to communicate with, support for Beep was dropped in Windows Vista and Windows XP 64-Bit Edition.

在Windows 7中,蜂鸣被改写蜂鸣声传递到会话的默认声音设备。这通常是声卡,在终端服务下运行,除了,在这种情况下蜂鸣声在客户端上呈现。

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.

这篇关于我为什么不调用Windows 7中的蜂鸣功能后听到任何声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆