如何得到系统的报警声音(100分)

  • 主题发起人 主题发起人 衣雪峰
  • 开始时间 开始时间

衣雪峰

Unregistered / Unconfirmed
GUEST, unregistred user!
各位富翁:我想得到一个API函数当计算机没有音箱的时候得到系统的报警声音!
 
beep可以的
 
The MessageBeep function plays a waveform sound. The waveform sound for each sound type is identified by an entry in the [sounds] section of the registry. <br><br>BOOL MessageBeep(<br><br> &nbsp; &nbsp;UINT uType // sound type &nbsp;<br> &nbsp; ); <br> <br><br>Parameters<br><br>uType<br><br>Specifies the sound type, as identified by an entry in the [sounds] section of the registry. This parameter can be one of the following values: <br><br>Value Sound<br>0xFFFFFFFF Standard beep using the computer speaker<br>MB_ICONASTERISK SystemAsterisk<br>MB_ICONEXCLAMATION SystemExclamation<br>MB_ICONHAND SystemHand<br>MB_ICONQUESTION SystemQuestion<br>MB_OK SystemDefault
 
beep(200,2000)<br>前一参数是频率,后一个是时长!
 
BEEP具体怎么用呢。能举个例子吗?
 
Beep<br>The Beep function generates simple tones on the speaker. The function is synchronous; it does not return control to its caller until the sound finishes. <br>BOOL Beep(<br> &nbsp;DWORD dwFreq, &nbsp; &nbsp; &nbsp;// sound frequency<br> &nbsp;DWORD dwDuration &nbsp; // sound duration<br>);<br>Parameters<br>dwFreq <br>Windows NT/ 2000: [in] Specifies the frequency, in hertz, of the sound. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF). <br>dwDuration <br>Windows NT/ 2000: [in] Specifies the duration, in milliseconds, of the sound. <br>Return Values<br>If the function succeeds, the return value is nonzero.<br>If the function fails, the return value is zero. To get extended error information, call GetLastError. <br>Remarks<br>Windows 95: The Beep function ignores the dwFreq and dwDuration parameters. On computers with a sound card, the function plays the default sound event. On computers
 
BEEP()函数是音箱发音,而非喇叭发音
 
喇叭发音用Windows的beep:<br>Windows.Beep(200,200); dwfreq声音频率hz,dwDuration声音长度ms<br>~~~~~~~~<br>在dos下喇叭发音:<br>Microsoft Windows 2000 [Version 5.00.2195]<br>(C) 版权所有 1985-2000 Microsoft Corp.<br><br>C:/Documents and Settings/Administrator&gt;cd/<br><br>C:/&gt;copy con a.bat<br>^G^G<br>^Z<br>已复制 &nbsp; &nbsp; &nbsp; &nbsp; 1 个文件。<br><br>C:/&gt;a.bat
 
procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> &nbsp;windows.Beep(200,2000);<br>end;
 
大家发的我都试验了一下。但是得到的都是。音箱的声音。不是主板的声音。各位还有什么高见吗?
 
呵呵,没有音箱了,哪来的声音,短见了.
 
把音箱连接主机的线拔掉先,再听听从哪儿发出来的声音!<br>前提示声卡驱动正常:P<br>Windows.Beep(500,2000);
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=2001437<br>随便搜了一个,看来只能写汇编了
 
ff_ff,你是真不知道还是........<br>windows.Beep(200,2000);<br>确实是主板的声音,你把音箱拔了试试
 
后退
顶部