Make the computer to play a beep sound
npm install a1-beep> Upgrading to V2: the package is a dual cjs-esm so no update should be required.
Play a beep sound on the computer.
Beep is usually a \u07 character printed to console. Unfortunately, on modern computers beeping is disabled.
Pre-requisite: Make sure that the aplay command is installed (aplay is already installed by default in Ubuntu and other distros).
Then, simply write:
``javascript`
const { beep } = require('a1-beep')
beep() //normal beep
Complex beeps, like songs, can also be played. Whitespace means 200ms of silence
`javascript``
beep('. . ... .... ..')
Notes:
beep() returns inmediately (and not async function) because there is no need for waiting beep to finish.