beep()

Generates a beep sound with specified frequency, duration, and volume.

Syntax

beep(frequency, time, volume)

Parameters

Parameter Type Description Comment
frequency Number Frequency of the beep sound in Hz. Default is 440 Hz.
time Number Duration of the beep sound in milliseconds. Default is 200 ms.
volume Number Volume of the beep sound in percentage (0 to 100). Default is 100.

Return Value

Examples

Generate a beep with the default parameters (440 Hz, 200 ms, 100 volume)

beep(); 

Generate a beep with 1000 Hz, 500 ms, and 80 volume

beep(1000, 500, 80); 

Generate a beep with 500 Hz, 1000 ms, and 50 volume

beep(500, 1000, 50); 

See also

beep
siren
sound_load
sound_unload
sound_play
sound_stop
sound_is_playing