Plays an error beep through the device's speaker. An error beep is a two-toned beep with the first beep higher than the second beep.
- You want your script to play an error beep.
- You want to override the default beeps using
WLEvent.on(“beep”, …)and play a custom error beep(s) instead.
Device.errorBeep() are asynchronous and added to a beep queue, meaning that this call will immediately return.
Device.errorBeep(frequency, durationMilliseconds, trailingSilence);
|frequency||Tone frequency in hertz for the second beep. The first beep will be pitched higher by 400Hz.||Number||Required||Integer between 100 and 2000|
|durationMilliseconds||Duration of a regular beep in milliseconds. An error beep is 4x longer than a regular beep. For example, if you specify 500 ms, the first tone beeps for 1000 ms and the second tone beeps for 1000 ms, making the total duration of the error beep 2000 ms.||Number||Required||Integer between 1 and 100000|
|trailingSilence||Amount of time in milliseconds that no tone should be played after the second beep.||Number||Required||Integer between 0 and 100000|
/* The device will beep twice, once at 800Hz and once at 400Hz, for a total duration of 2000
* milliseconds with a 50 millisecond trailing silence
* after the second beep.