Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/ax1/a1-beep
- Owner: ax1
- Created: 2019-09-16T18:09:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-19T23:27:55.000Z (over 2 years ago)
- Last Synced: 2025-01-29T08:35:05.494Z (14 days ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
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.