Shing Lyu's Random Tech Facts

This is a micro-blog where I write one-liners about random tech stuff I learned.

Generating a notification sound in command-line

You want to play a notification sound in a Linux shell script, but don’t want to download any sound files (e.g. MP3, WAV, MIDI). Here is a script that generates the sound on-the-fly:

First install SoX, the Swiss Army knife of sound processing programs.

sudo apt-get install sox


play -n synth 0.3 pluck A3 vol -20dB repeat 2