Beep Function

Sounds a tone through the computer's speaker.

Public Sub Beep()

Remarks

The pitch and duration of the beep depend on your hardware and system software and therefore vary among computers.

Note

The Beep function requires UIPermission at the SafeTopLevelWindows level, which may affect its execution in partial-trust situations. For more information, see Requesting Permissions and UIPermission Class.

Example

This example uses the Beep function to sound a long, uninterrupted tone through the computer's speaker.

Dim I As Integer 
For I = 1 To 100   ' Loop 100 times.
   Beep   ' Sound a tone.
Next I

Smart Device Developer Notes

This function is not supported.

Requirements

Namespace:Microsoft.VisualBasic

**Module:**Interaction

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

See Also

Reference

Visual Basic Run-Time Library Members

Other Resources

Playing Sounds