procedure TForm1.Button1Click(Sender: TObject);
begin
Beep;
end;
===========================================
如上,本人就在一个按钮的Click事件中加上了一个Beep,这样做是否正确?如果正确,我在运行时
怎么听不到声音?
begin
Beep;
end;
===========================================
如上,本人就在一个按钮的Click事件中加上了一个Beep,这样做是否正确?如果正确,我在运行时
怎么听不到声音?
Windows.Beep(1000,500)能用就行吧,
原因是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.
而且是声卡发的声音呀