procedure TForm1.Button1Click(Sender: TObject);
begin
    Beep;
end;
===========================================
如上,本人就在一个按钮的Click事件中加上了一个Beep,这样做是否正确?如果正确,我在运行时
怎么听不到声音?

解决方案 »

  1.   

    我用Windows.Beep(500,500)这种形式就可以听到声音,而Beep就不行啊!这是怎么回事呢???
      

  2.   

    因为,人耳感觉不到,你要改变频率
    Windows.Beep(1000,500)能用就行吧,
      

  3.   

    我是说用Beep函数运行时听不到声音!!!Beep到底有没有用啊?
      

  4.   

    Windows.Beep才可以,Delphi自己的SysUtils.Beep是不行的
    原因是Delphi的SysUtils.Beep是API的MessageBeep
    MessageBeep attempts to play the system default sound. If it cannot play the system default sound, the function produces a standard beep sound through the computer speaker. 
    The user can disable the warning beep by using the Control Panel Sound application. MessageBeep要定义了系统声音才有反映的===BeepThe Beep function generates simple tones on the speaker. The function is synchronous; it does not return control to its caller until the sound finishes. BOOL Beep(    DWORD dwFreq, // sound frequency, in hertz 
        DWORD dwDuration  // sound duration, in milliseconds 
       );
     ParametersdwFreqWindows NT:Specifies the frequency, in hertz, of the sound. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF). Windows 95:The parameter is ignored.dwDurationWindows NT:Specifies the duration, in milliseconds, of the sound. Windows 95:The parameter is ignored.
      

  5.   

    beep应该是从蜂鸣器里出来的,不是声卡
      

  6.   

    不会吧我试过了,我的可以啊注:我用的是D7,XP系统
    而且是声卡发的声音呀