For more information about beep, messagebeep, and Windows. Beep

Source: Internet
Author: User
Delphi defines the beep method in the sysutils unit and can make a sound, which is generally used for reminder and debugging.

Beep is actually the called API function: messagebeep (mb_ OK );
Messagebeep can be used to call different audio files in the following ways:

 
Messagebeep (mb_ OK); messagebeep (mb_iconhand); messagebeep (messages); {This does not sound, do not know why} messagebeep (messages); messagebeep ($ ffffff ); {same as messagebeep (mb_ OK );}

  

Beep is also an API function that specifies the sound height and length. Because it has the same name as sysutils. Beep, you should call it like this:
Windows. Beep (pitch, length );

For example, windows. Beep (440,200 0) will play an international standard sound (440Hz) for 2 seconds.
The value range of the first parameter is $25-$ 7ffff.

The followingProgramThe first sentence:

 unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) button1: tbutton; Procedure button1click (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} procedure tform1.button1click (Sender: tobject); const T = 800; begin windows. beep (330, T); windows. beep (392, T); windows. beep (262, T * 2); windows. beep (294, T); windows. beep (330, T); windows. beep (196, T * 2); windows. beep (262, T); windows. beep (294, T); windows. beep (330, T); windows. beep (392, T); windows. beep (294, T * 4); end.

   
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.