MyNixOS website logo
Description

Easily Play Notification Sounds on any Platform.

The main function of this package is beep(), with the purpose to make it easy to play notification sounds on whatever platform you are on. It is intended to be useful, for example, if you are running a long analysis in the background and want to know when it is ready.

beepr: Easily Play Notification Sounds on any Platform

beepr is an R package that contains one main function, beep(), with one purpose: To make it easy to play notification sounds on whatever platform you are on. It is intended to be useful, for example, if you are running a long analysis in the background and want to know when it is ready.

A derivative function, beep_on_error(), wraps an expression and will only beep if an error occurs when that expression is evaluated.

Installation

beepr is available on CRAN and can be installed from within R by running:

install.packages("beepr")

You can also grab the development version of beepr directly from github:

library(devtools)
install_github("rasmusab/beepr")

Requirements

If you are using Windows or OS X beepr relies on the audio package for sound playback and no external program is needed.

If you're on Linux beepr relies on you having either the paplay utility from the Pulse Audio system, the aplay utility from the ALSA system or VLC media player installed and on the PATH. Chances are that you already have one of these. If you are on Debian/Ubuntu you can otherwise get VLC by running the following in a terminal:

sudo apt-get install vlc

Details

beep() plays a short sound which is useful if you want to get notified, for example, when a script has finished. As an added bonus there are a number of different sounds to choose from.

Usage

beep(sound = 1, expr = NULL)

Arguments

sound character string or number specifying what sound to be played by either specifying one of the built in sounds or specifying the path to a wav file. The default is 1. Possible sounds are:

  1. "ping"
  2. "coin"
  3. "fanfare"
  4. "complete"
  5. "treasure"
  6. "ready"
  7. "shotgun"
  8. "mario"
  9. "wilhelm"
  10. "facebook"
  11. "sword"

If sound does not match any of the sounds above, or is a valid path, a random sound will be played.

expr An optional expression to be executed before the sound.

Examples

# Update all packages and "ping" when it's ready
update.packages(ask=FALSE); beep()

#Play a fanfare instead of a "ping".
beep("fanfare")
#or
beep(3)

# Play a random sound
beep(0)

# Play a sound if an error occurs
beep_on_error(1 + "a", sound = "wilhelm")
Metadata

Version

2.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows