Re:Beep in Delphi???
Quote
mil...@usafe14.ramstein.af.mil (Eric Miles) wrote:
>li...@wintermute.co.uk (Iain Russell) wrote:
>[Can I get Delphi to beep as in Turbo Pascal?]
>There was much discussion recently on this issue. The consenses was
>basically no.
Well, from the latest Delphi Developer's Group newsletter (I just went to
one of their conferences) there's a routine by Steve Keyser (CIS). I'm not
sure if it works properly since the PC I use has some werid kinda sound
setup, but here it is, using 'obsolete' Windows API calls... maybe you
discussed this before? Is it valid code?
procedure MakeSound(note, duration: Integer);
{Purpose: Play a sound on the PC's speaker}
var
result:Integer;
begin
if (note<1) or (note>84) then exit;
if (duration < 1 ) or (duration > 128) then exit;
result:=OpenSound;
result:=SetVoiceQueueSize(1, 6);
result:=StartSound;
result:=WaitSoundState(S_QUEUEEMPTY);
CloseSound;
end;
Iain Russell
http://www.wintermute.co.uk/users/libra/