siren()

Generates a siren-like sound with specified frequency, duration, and volume.

Syntax

siren(frequency, time, volume)

Parameters

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

Return Value

Examples

Generate a siren sound with the default parameters (440 Hz, 1200 ms, 100 volume)

siren();

Generate a siren sound with 1000 Hz, 2000 ms, and 80 volume

siren(1000, 2000, 80); 

Generate a siren sound with 500 Hz, 1500 ms, and 50 volume

siren(500, 1500, 50); 

See also

beep
siren
sound_load
sound_unload
sound_play
sound_stop
sound_is_playing