Board index » delphi » Simple sound (Bleep) Help?

Simple sound (Bleep) Help?

There has to be a simple answer to: how can I get Delphi to issue a
bleep?

The following works however Delphi creates an unwanted window in the
process:

   Write Chr(7);

Can somebody suggest a better way for a Delphi/Pascal newbe?
Thanks John.

 

Re:Simple sound (Bleep) Help?


Trye this -

MessageBeep(1);

Look up the WinAPI help for beep options.
============================================
Reza Bin Raquib, RRAQ...@PANIX.COM
SYSTEMS 2000, 516-698-6391
"We will make your business look good"
============================================

Re:Simple sound (Bleep) Help?


MessageBeep(0) is the default Windows beep (from a .wav file as setup for
Sounds in Control Panel for the default beep). Instead of zero, using
65535 should beep the PC speaker. Using 64 should sound the .wav file
configured for the information notice; 48 should sound the .wav file
configured for the exclamation notice; 32 should sound the .wav file for
the question notice; 16 should sound the .wav file for the stop notice.

Drop an OK button on a new form and enter messagebeep(0); in the OnClick
event handler, then run. Click the button, it beeps. Hope this helps.

Tim.

Re:Simple sound (Bleep) Help?


softw...@aladdin.co.uk (John Noden, SoftWise Ltd) wrote:

Quote
>There has to be a simple answer to: how can I get Delphi to issue a
>bleep?
>The following works however Delphi creates an unwanted window in the
>process:
>   Write Chr(7);
>Can somebody suggest a better way for a Delphi/Pascal newbe?
>Thanks John.

The answer is:
   MessageBeep(1);

Many thanks to those of you that emailed me with the answer.

Re:Simple sound (Bleep) Help?


softw...@aladdin.co.uk (John Noden, SoftWise Ltd) wrote:

Quote
>There has to be a simple answer to: how can I get Delphi to issue a
>bleep?
>The following works however Delphi creates an unwanted window in the
>process:
>   Write Chr(7);

Use WinAPI's MessageBeep(0) or whatever argument. The argument doesn't
seem to affect the beep sound. I can't control the tone or duration
like the following code for DOS:

    Sound(1500); delay(500);

Please tell me if you find the way.

Regards,
Wai Wong.

Re:Simple sound (Bleep) Help?


In article <4184hf$...@alpha.aladdin.co.uk>,
   softw...@aladdin.co.uk (John Noden, SoftWise Ltd) wrote:

Quote
>There has to be a simple answer to: how can I get Delphi to issue a
>bleep?

MessageBeep(0);

Other Threads