- Notifications
You must be signed in to change notification settings - Fork35
rasmusab/beepr
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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.
beepr is available onCRAN and can be installed from within R by running:
install.packages("beepr")You can also grab the development version ofbeepr directly from github:
library(devtools)install_github("rasmusab/beepr")If you are using Windows or OS Xbeepr relies on theaudio package for sound playback and no external program is needed.
If you're on Linuxbeepr relies on you having either thepaplay utility from the Pulse Audio system, theaplay utility from the ALSA system orVLC 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 vlcbeep() 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.
beep(sound = 1, expr = NULL)
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:
- "ping"
- "coin"
- "fanfare"
- "complete"
- "treasure"
- "ready"
- "shotgun"
- "mario"
- "wilhelm"
- "facebook"
- "sword"
Ifsound does not match any of the sounds above, or is a valid path, a random sound will be played.
exprAn optional expression to be executed before the sound.
# Update all packages and "ping" when it's readyupdate.packages(ask=FALSE); beep()#Play a fanfare instead of a "ping".beep("fanfare")#orbeep(3)# Play a random soundbeep(0)# Play a sound if an error occursbeep_on_error(1 + "a", sound = "wilhelm")About
The package that sounds as it is called.
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.