Beep Function

Sounds a tone through the computer's speaker.

Public Sub Beep()


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


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.


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.




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

See Also


Visual Basic Run-Time Library Members

Other Resources

Playing Sounds