Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ax1/a1-beep

Make the computer to play a beep sound
https://github.com/ax1/a1-beep

Last synced: 5 days ago
JSON representation

Make the computer to play a beep sound

Awesome Lists containing this project

README

        

# 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.

## Why

Beep is usually a `\u07` character printed to console. Unfortunately, on modern computers beeping is disabled.

## Usage

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.